#1436: synchronizeWithArray fails with m:n relations and transient objects
-------------------------+--------------------------------------------------
Reporter: jasoneisen | Owner: romanb
Type: defect | Status: new
Priority: minor | Milestone: 1.1.0
Component: Record | Version: 1.0
Resolution: | Keywords:
Has_test: 1 | Mystatus: Pending Core Response
Has_patch: 1 |
-------------------------+--------------------------------------------------
Changes (by jasoneisen):
* has_patch: 0 => 1
* has_test: 0 => 1
Old description:
> Creating ticket to get # to write test
New description:
Fixes SynchronizeWithArray() to work with m2m relations. Fixes an already
failing test case dealing with this method as well.
Requires an additional argument added to link and unlink to postpone to
later, with protected storage vars for pending links and unlinks which are
later called by unitofwork on save().
Also fixes unlinking not going ahead and removing references in memory
when the keys array is empty.
Usage pasted from test case:
{{{
$user = Doctrine_Query::create()->from('User u')->fetchOne();
$userArray = array(
'Group' => array(
'_identifiers' => array(
$this->group_one => '1',
$this->group_two => '1',
$this->group_three => ''
)
));
$user->synchronizeWithArray($userArray);
}}}
The protected vars are probably redundant and could be reduced to one,
with one getter/setter.
--
Ticket URL: <http://trac.doctrine-project.org/ticket/1436#comment:1>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"doctrine-svn" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---