#1672: Doctrine_Record::claimRelatedCollections($record)
-----------------------------------+----------------------------------------
Reporter: adamthehutt | Owner: romanb
Type: enhancement | Status: new
Priority: minor | Milestone: 1.1.0
Component: Relations | Version: 1.0.3
Keywords: | Has_test: 0
Mystatus: Pending Core Response | Has_patch: 0
-----------------------------------+----------------------------------------
I had a scenario where I needed to "merge" two Doctrine_Record objects.
As part of that procedure, I wrote the following method:
{{{
public function claimRelatedCollections(Doctrine_Record $record)
{
$relations = $this->getTable()->getRelations();
foreach($relations as $alias => $relation)
{
if($relation instanceof Doctrine_Relation_ForeignKey &&
$record->$alias instanceof Doctrine_Collection)
{
$this->$alias->merge($record->$alias);
}
}
}
}}}
Is this something that would be useful in the core? It's actually a
situation I encounter with some frequency, but I may be the only one.
--
Ticket URL: <http://trac.doctrine-project.org/ticket/1672>
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
-~----------~----~----~----~------~----~------~--~---