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
f731a083
Commit
f731a083
authored
Oct 12, 2009
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0][DDC-41] Fixed. Also related to DDC-2.
parent
c71b4ebd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
5 deletions
+22
-5
Proxy.php
lib/Doctrine/ORM/Proxy/Proxy.php
+11
-0
ProxyClassGenerator.php
lib/Doctrine/ORM/Proxy/ProxyClassGenerator.php
+2
-2
UnitOfWork.php
lib/Doctrine/ORM/UnitOfWork.php
+9
-3
No files found.
lib/Doctrine/ORM/Proxy/Proxy.php
0 → 100644
View file @
f731a083
<?php
namespace
Doctrine\ORM\Proxy
;
/**
* Marker interface for proxy classes.
*
* @author Roman Borschel <roman@code-factory.org>
* @since 2.0
*/
interface
Proxy
{}
\ No newline at end of file
lib/Doctrine/ORM/Proxy/ProxyClassGenerator.php
View file @
f731a083
...
...
@@ -214,7 +214,7 @@ class ProxyClassGenerator
'<?php
/** This class was generated by the Doctrine ORM. DO NOT EDIT THIS FILE. */
namespace Doctrine\Generated\Proxies {
class <proxyClassName> extends \<className> {
class <proxyClassName> extends \<className>
implements \Doctrine\ORM\Proxy\Proxy
{
private $_entityPersister;
private $_identifier;
private $_loaded = false;
...
...
@@ -247,7 +247,7 @@ namespace Doctrine\Generated\Proxies {
'<?php
/** This class was generated by the Doctrine ORM. DO NOT EDIT THIS FILE. */
namespace Doctrine\Generated\Proxies {
class <proxyClassName> extends \<className> {
class <proxyClassName> extends \<className>
implements \Doctrine\ORM\Proxy\Proxy
{
private $_em;
private $_assoc;
private $_owner;
...
...
lib/Doctrine/ORM/UnitOfWork.php
View file @
f731a083
...
...
@@ -26,7 +26,8 @@ use Doctrine\Common\Collections\ArrayCollection,
Doctrine\Common\DoctrineException
,
Doctrine\Common\NotifyPropertyChanged
,
Doctrine\Common\PropertyChangedListener
,
Doctrine\ORM\Event\LifecycleEventArgs
;
Doctrine\ORM\Event\LifecycleEventArgs
,
Doctrine\ORM\Proxy\Proxy
;
/**
* The UnitOfWork is responsible for tracking changes to objects during an
...
...
@@ -554,10 +555,13 @@ class UnitOfWork implements PropertyChangedListener
if
(
!
$assoc
->
isCascadePersist
)
{
return
;
// "Persistence by reachability" only if persist cascade specified
}
// Look through the entities, and in any of their associations, for transient
// enities, recursively. ("Persistence by reachability")
if
(
$assoc
->
isOneToOne
())
{
if
(
$value
instanceof
Proxy
)
{
return
;
// Ignore proxy objects
}
$value
=
array
(
$value
);
}
$targetClass
=
$this
->
_em
->
getClassMetadata
(
$assoc
->
targetEntityName
);
...
...
@@ -586,7 +590,9 @@ class UnitOfWork implements PropertyChangedListener
$data
[
$name
]
=
$refProp
->
getValue
(
$entry
);
$changeSet
[
$name
]
=
array
(
null
,
$data
[
$name
]);
if
(
isset
(
$targetClass
->
associationMappings
[
$name
]))
{
$this
->
_computeAssociationChanges
(
$targetClass
->
associationMappings
[
$name
],
$data
[
$name
]);
if
(
$data
[
$name
]
!==
null
)
{
$this
->
_computeAssociationChanges
(
$targetClass
->
associationMappings
[
$name
],
$data
[
$name
]);
}
}
}
...
...
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