1
0
mirror of synced 2024-12-05 03:06:05 +03:00
This commit is contained in:
doctrine 2006-04-14 10:43:25 +00:00
parent e89a841b00
commit 87fa5b245f

View File

@ -885,72 +885,6 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
}
endswitch;
/**
$coll = false;
if($fk instanceof Doctrine_ForeignKey ||
$fk instanceof Doctrine_LocalKey) {
$graph = $table->getDQLParser();
// get the local identifier
$id = $this->get($local);
if(empty($id)) {
$this->references[$name] = $table->create();
if($this->table->hasPrimaryKey($fk->getLocal())) {
$this->references[$name]->set($fk->getForeign(),$this);
} else {
$this->set($fk->getLocal(),$this->references[$name]);
}
} else {
if($this->table->hasPrimaryKey($fk->getForeign())) {
try {
$coll = new Doctrine_Collection($table);
$coll[0] = $table->getCache()->fetch($id);
} catch(InvalidKeyException $e) {
$coll = false;
}
}
if( ! $coll) {
$query = "FROM ".$name." WHERE ".$name.".".$fk->getForeign()." = ?";
$coll = $graph->query($query,array($id));
}
if($fk->getType() == Doctrine_Table::ONE_COMPOSITE ||
$fk->getType() == Doctrine_Table::ONE_AGGREGATE) {
if($coll->contains(0)) {
$this->references[$name] = $coll[0];
$this->originals[$name] = clone $coll[0];
} else {
$this->references[$name] = $table->create();
if($this->table->hasPrimaryKey($fk->getLocal())) {
$this->references[$name]->set($fk->getForeign(),$this);
} else {
$this->set($fk->getLocal(),$this->references[$name]);
}
}
} else {
$this->references[$name] = $coll;
$this->references[$name]->setReference($this,$fk);
$this->originals[$name] = clone $coll;
}
}
*/
break;
endswitch;
}