diff --git a/classes/Record.class.php b/classes/Record.class.php index 0b77fcf60..0ae7d4ea0 100644 --- a/classes/Record.class.php +++ b/classes/Record.class.php @@ -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; }