thrownewDoctrine_Record_Exception("Couldn't call Doctrine::set(), second argument should be an instance of Doctrine_Record when setting one-to-one references.");
}
if($relinstanceofDoctrine_Relation_LocalKey){
$this->set($rel->getLocal(),$value,false);
}else{
$value->set($rel->getForeign(),$this,false);
if($value!==self::$_null){
// one-to-one relation found
if(!($valueinstanceofDoctrine_Record)){
thrownewDoctrine_Record_Exception("Couldn't call Doctrine::set(), second argument should be an instance of Doctrine_Record or Doctrine_Null when setting one-to-one references.");