From c8e5c3e4e394bd756905adb128ff7ed8babf732a Mon Sep 17 00:00:00 2001 From: pookey Date: Thu, 21 Sep 2006 14:33:15 +0000 Subject: [PATCH] pookey: fixes #92 --- Doctrine/EventListener/Chain.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Doctrine/EventListener/Chain.php b/Doctrine/EventListener/Chain.php index 2e57dad0c..767880a7d 100644 --- a/Doctrine/EventListener/Chain.php +++ b/Doctrine/EventListener/Chain.php @@ -12,7 +12,7 @@ class Doctrine_EventListener_Chain extends Doctrine_Access { * @param Doctrine_EventListener $listener * @return void */ - public function add(Doctrine_EventListener $listener) { + public function addListener(Doctrine_EventListener $listener) { $this->listeners[] = $listener; } /** @@ -22,7 +22,7 @@ class Doctrine_EventListener_Chain extends Doctrine_Access { * @param mixed $key * @return mixed */ - public function get($key) { + public function getListener($key) { if( ! isset($this->listeners[$key])) return null; @@ -35,7 +35,7 @@ class Doctrine_EventListener_Chain extends Doctrine_Access { * @param Doctrine_EventListener $listener * @return void */ - public function set($key, Doctrine_EventListener $listener) { + public function setListener($key, Doctrine_EventListener $listener) { $this->listeners[$key] = $listener; } @@ -97,13 +97,15 @@ class Doctrine_EventListener_Chain extends Doctrine_Access { public function onGetProperty(Doctrine_Record $record, $property, $value) { foreach($this->listeners as $listener) { - $listener->onGetProperty($record, $property, $value); + $value = $listener->onGetProperty($record, $property, $value); } + return $value; } public function onSetProperty(Doctrine_Record $record, $property, $value) { foreach($this->listeners as $listener) { - $listener->onSetProperty($record, $property, $value); + $value = $listener->onSetProperty($record, $property, $value); } + return $value; } public function onInsert(Doctrine_Record $record) {