Commit 3ad6e01c authored by jackbravo's avatar jackbravo

Simplified test for isComposite

parent bbf5b62a
...@@ -442,17 +442,14 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module ...@@ -442,17 +442,14 @@ 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: $obj = $record->get($fk->getAlias());
case Doctrine_Relation::MANY_COMPOSITE: if ( $obj instanceof Doctrine_Record &&
$obj = $record->get($fk->getAlias()); $obj->state() != Doctrine_Record::STATE_LOCKED) {
if ( $obj instanceof Doctrine_Record &&
$obj->state() != Doctrine_Record::STATE_LOCKED) { $obj->delete($this->conn);
$obj->delete($this->conn); }
}
break;
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment