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
cced2bd6
Commit
cced2bd6
authored
Dec 15, 2009
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0][DDC-211] Fixed collection diff calculation.
parent
e6a10d36
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
12 deletions
+4
-12
PersistentCollection.php
lib/Doctrine/ORM/PersistentCollection.php
+4
-12
No files found.
lib/Doctrine/ORM/PersistentCollection.php
View file @
cced2bd6
...
...
@@ -275,7 +275,8 @@ final class PersistentCollection implements \Doctrine\Common\Collections\Collect
*/
public
function
getDeleteDiff
()
{
return
array_udiff
(
$this
->
_snapshot
,
$this
->
_coll
->
toArray
(),
array
(
$this
,
'_compareRecords'
));
return
array_udiff_assoc
(
$this
->
_snapshot
,
$this
->
_coll
->
toArray
(),
function
(
$a
,
$b
)
{
return
$a
===
$b
?
0
:
1
;});
}
/**
...
...
@@ -286,17 +287,8 @@ final class PersistentCollection implements \Doctrine\Common\Collections\Collect
*/
public
function
getInsertDiff
()
{
return
array_udiff
(
$this
->
_coll
->
toArray
(),
$this
->
_snapshot
,
array
(
$this
,
'_compareRecords'
));
}
/**
* Compares two records. To be used on _snapshot diffs using array_udiff.
*
* @return integer
*/
private
function
_compareRecords
(
$a
,
$b
)
{
return
$a
===
$b
?
0
:
1
;
return
array_udiff_assoc
(
$this
->
_coll
->
toArray
(),
$this
->
_snapshot
,
function
(
$a
,
$b
)
{
return
$a
===
$b
?
0
:
1
;});
}
/**
...
...
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