Commit 87fa5b24 authored by doctrine's avatar doctrine

--no commit message

--no commit message
parent e89a841b
......@@ -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;
}
......
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