Commit c8e5c3e4 authored by pookey's avatar pookey

pookey: fixes #92

parent 0ad201e5
...@@ -12,7 +12,7 @@ class Doctrine_EventListener_Chain extends Doctrine_Access { ...@@ -12,7 +12,7 @@ class Doctrine_EventListener_Chain extends Doctrine_Access {
* @param Doctrine_EventListener $listener * @param Doctrine_EventListener $listener
* @return void * @return void
*/ */
public function add(Doctrine_EventListener $listener) { public function addListener(Doctrine_EventListener $listener) {
$this->listeners[] = $listener; $this->listeners[] = $listener;
} }
/** /**
...@@ -22,7 +22,7 @@ class Doctrine_EventListener_Chain extends Doctrine_Access { ...@@ -22,7 +22,7 @@ class Doctrine_EventListener_Chain extends Doctrine_Access {
* @param mixed $key * @param mixed $key
* @return mixed * @return mixed
*/ */
public function get($key) { public function getListener($key) {
if( ! isset($this->listeners[$key])) if( ! isset($this->listeners[$key]))
return null; return null;
...@@ -35,7 +35,7 @@ class Doctrine_EventListener_Chain extends Doctrine_Access { ...@@ -35,7 +35,7 @@ class Doctrine_EventListener_Chain extends Doctrine_Access {
* @param Doctrine_EventListener $listener * @param Doctrine_EventListener $listener
* @return void * @return void
*/ */
public function set($key, Doctrine_EventListener $listener) { public function setListener($key, Doctrine_EventListener $listener) {
$this->listeners[$key] = $listener; $this->listeners[$key] = $listener;
} }
...@@ -97,13 +97,15 @@ class Doctrine_EventListener_Chain extends Doctrine_Access { ...@@ -97,13 +97,15 @@ class Doctrine_EventListener_Chain extends Doctrine_Access {
public function onGetProperty(Doctrine_Record $record, $property, $value) { public function onGetProperty(Doctrine_Record $record, $property, $value) {
foreach($this->listeners as $listener) { 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) { public function onSetProperty(Doctrine_Record $record, $property, $value) {
foreach($this->listeners as $listener) { foreach($this->listeners as $listener) {
$listener->onSetProperty($record, $property, $value); $value = $listener->onSetProperty($record, $property, $value);
} }
return $value;
} }
public function onInsert(Doctrine_Record $record) { public function onInsert(Doctrine_Record $record) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment