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
60136a4b
Commit
60136a4b
authored
May 24, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
134c944b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
UnitOfWork.php
lib/Doctrine/Connection/UnitOfWork.php
+10
-12
No files found.
lib/Doctrine/Connection/UnitOfWork.php
View file @
60136a4b
...
@@ -142,25 +142,23 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module
...
@@ -142,25 +142,23 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module
{
{
$saveLater
=
array
();
$saveLater
=
array
();
foreach
(
$record
->
getReferences
()
as
$k
=>
$v
)
{
foreach
(
$record
->
getReferences
()
as
$k
=>
$v
)
{
$fk
=
$record
->
getTable
()
->
getRelation
(
$k
);
$rel
=
$record
->
getTable
()
->
getRelation
(
$k
);
if
(
$fk
instanceof
Doctrine_Relation_ForeignKey
||
$fk
instanceof
Doctrine_Relation_LocalKey
)
{
if
(
$rel
instanceof
Doctrine_Relation_ForeignKey
||
$local
=
$fk
->
getLocal
();
$rel
instanceof
Doctrine_Relation_LocalKey
)
{
$foreign
=
$fk
->
getForeign
();
$local
=
$rel
->
getLocal
();
$foreign
=
$rel
->
getForeign
();
if
(
$record
->
getTable
()
->
hasPrimaryKey
(
$
fk
->
getLocal
()))
{
if
(
$record
->
getTable
()
->
hasPrimaryKey
(
$
rel
->
getLocal
()))
{
if
(
!
$record
->
exists
())
{
if
(
!
$record
->
exists
())
{
$saveLater
[
$k
]
=
$
fk
;
$saveLater
[
$k
]
=
$
rel
;
}
else
{
}
else
{
$v
->
save
(
$this
->
conn
);
$v
->
save
(
$this
->
conn
);
}
}
}
else
{
}
else
{
// ONE-TO-ONE relationship
// ONE-TO-ONE relationship
$obj
=
$record
->
get
(
$fk
->
getAlias
());
$obj
=
$record
->
get
(
$rel
->
getAlias
());
$obj
->
save
(
$this
->
conn
);
if
(
$obj
->
exists
())
{
$obj
->
save
(
$this
->
conn
);
}
}
}
}
}
...
...
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