1
0
mirror of synced 2024-12-13 22:56:04 +03:00

missed some from previous commit

This commit is contained in:
pookey 2006-11-06 18:02:42 +00:00
parent 60985b5697
commit e640e78aa8

View File

@ -25,13 +25,13 @@
* @license LGPL * @license LGPL
* @package Doctrine * @package Doctrine
*/ */
class Doctrine_Db_EventListener_Chain extends Doctrine_Access implements Doctrine_DB_EventListener_Interface { class Doctrine_Db_EventListener_Chain extends Doctrine_Access implements Doctrine_Db_EventListener_Interface {
private $listeners = array(); private $listeners = array();
public function add($listener, $name = null) { public function add($listener, $name = null) {
if( ! ($listener instanceof Doctrine_Db_EventListener_Interface) && if( ! ($listener instanceof Doctrine_Db_EventListener_Interface) &&
! ($listener instanceof Doctrine_Overloadable)) ! ($listener instanceof Doctrine_Overloadable))
throw new Doctrine_Db_Exception("Couldn't add eventlistener. EventListeners should implement either Doctrine_DB_EventListener_Interface or Doctrine_Overloadable"); throw new Doctrine_Db_Exception("Couldn't add eventlistener. EventListeners should implement either Doctrine_Db_EventListener_Interface or Doctrine_Overloadable");
if($name === null) if($name === null)
$this->listeners[] = $listener; $this->listeners[] = $listener;
@ -49,7 +49,7 @@ class Doctrine_Db_EventListener_Chain extends Doctrine_Access implements Doctrin
public function set($name, $listener) { public function set($name, $listener) {
if( ! ($listener instanceof Doctrine_Db_EventListener_Interface) && if( ! ($listener instanceof Doctrine_Db_EventListener_Interface) &&
! ($listener instanceof Doctrine_Overloadable)) ! ($listener instanceof Doctrine_Overloadable))
throw new Doctrine_Db_Exception("Couldn't set eventlistener. EventListeners should implement either Doctrine_DB_EventListener_Interface or Doctrine_Overloadable"); throw new Doctrine_Db_Exception("Couldn't set eventlistener. EventListeners should implement either Doctrine_Db_EventListener_Interface or Doctrine_Overloadable");
$this->listeners[$name] = $listener; $this->listeners[$name] = $listener;
} }