Simplified test for isComposite
This commit is contained in:
parent
bbf5b62a68
commit
3ad6e01c73
@ -442,9 +442,7 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module
|
|||||||
public function deleteComposites(Doctrine_Record $record)
|
public function deleteComposites(Doctrine_Record $record)
|
||||||
{
|
{
|
||||||
foreach ($record->getTable()->getRelations() as $fk) {
|
foreach ($record->getTable()->getRelations() as $fk) {
|
||||||
switch ($fk->getType()) {
|
if ($fk->isComposite()) {
|
||||||
case Doctrine_Relation::ONE_COMPOSITE:
|
|
||||||
case Doctrine_Relation::MANY_COMPOSITE:
|
|
||||||
$obj = $record->get($fk->getAlias());
|
$obj = $record->get($fk->getAlias());
|
||||||
if ( $obj instanceof Doctrine_Record &&
|
if ( $obj instanceof Doctrine_Record &&
|
||||||
$obj->state() != Doctrine_Record::STATE_LOCKED) {
|
$obj->state() != Doctrine_Record::STATE_LOCKED) {
|
||||||
@ -452,7 +450,6 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module
|
|||||||
$obj->delete($this->conn);
|
$obj->delete($this->conn);
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user