thrownewDoctrine_EventListener_Exception("Couldn't add eventlistener. EventListeners should implement either Doctrine_EventListener_Interface or Doctrine_Overloadable");
}
if($name===null){
$this->_listeners[]=$listener;
}else{
$this->_listeners[$name]=$listener;
}
}
/**
* returns a Doctrine_Record_Listener on success
* and null on failure
*
* @param mixed $key
* @return mixed
*/
publicfunctionget($key)
{
if(!isset($this->_listeners[$key])){
returnnull;
}
return$this->_listeners[$key];
}
/**
* set
*
* @param mixed $key
* @param Doctrine_Record_Listener $listener listener to be added
* @return Doctrine_Record_Listener_Chain this object