Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
753e9bd4
Commit
753e9bd4
authored
Sep 27, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #131
Ticket: 131
parent
ddf0ceab
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
15 deletions
+7
-15
Collection.php
lib/Doctrine/Collection.php
+1
-1
Hydrate.php
lib/Doctrine/Hydrate.php
+3
-1
Record.php
lib/Doctrine/Record.php
+3
-13
No files found.
lib/Doctrine/Collection.php
View file @
753e9bd4
...
...
@@ -96,7 +96,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
* getTable
* returns the table this collection belongs to
*
* @return
object
Doctrine_Table
* @return Doctrine_Table
*/
public
function
getTable
()
{
return
$this
->
table
;
...
...
lib/Doctrine/Hydrate.php
View file @
753e9bd4
...
...
@@ -417,7 +417,7 @@ abstract class Doctrine_Hydrate extends Doctrine_Access {
if
(
$fk
instanceof
Doctrine_LocalKey
)
$last
->
set
(
$fk
->
getLocal
(),
$record
->
getIncremented
(),
false
);
$last
->
initSingleReference
(
$record
,
$fk
);
$last
->
set
(
$fk
->
getAlias
(),
$record
);
$prev
[
$name
]
=
$record
;
break
;
...
...
@@ -428,6 +428,8 @@ abstract class Doctrine_Hydrate extends Doctrine_Access {
if
(
!
$last
->
hasReference
(
$alias
))
{
$prev
[
$name
]
=
$this
->
getCollection
(
$name
);
$last
->
initReference
(
$prev
[
$name
],
$fk
);
//$last->set($fk->getAlias(), $this->getCollection($name));
}
else
{
// previous entry found from identityMap
$prev
[
$name
]
=
$last
->
get
(
$alias
);
...
...
lib/Doctrine/Record.php
View file @
753e9bd4
...
...
@@ -741,6 +741,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
}
catch
(
Doctrine_Table_Exception
$e
)
{
throw
new
Doctrine_Record_Exception
(
"Unknown property / related component '
$name
'."
);
}
// one-to-many or one-to-one relation
if
(
$rel
instanceof
Doctrine_ForeignKey
||
$rel
instanceof
Doctrine_LocalKey
)
{
...
...
@@ -760,7 +762,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
throw
new
Doctrine_Record_Exception
(
"Couldn't call Doctrine::set(), second argument should be an instance of Doctrine_Record when setting one-to-one references."
);
if
(
$rel
->
getLocal
()
==
$this
->
table
->
getIdentifier
())
{
$
this
->
references
[
$name
]
->
set
(
$rel
->
getForeign
(),
$this
);
$
value
->
set
(
$rel
->
getForeign
(),
$this
,
false
);
}
else
{
$this
->
set
(
$rel
->
getLocal
(),
$value
);
}
...
...
@@ -1151,18 +1153,6 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
throw
new
Doctrine_Record_Exception
(
"Unknown reference
$name
"
);
}
/**
* initalizes a one-to-one relation
*
* @param Doctrine_Record $record
* @param Doctrine_Relation $connector
* @return void
*/
public
function
initSingleReference
(
Doctrine_Record
$record
,
Doctrine_Relation
$connector
)
{
$alias
=
$connector
->
getAlias
();
$this
->
references
[
$alias
]
=
$record
;
}
/**
* initalizes a one-to-many / many-to-many relation
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment