From c2967b35ff81617ad283aca1770c34879be656b3 Mon Sep 17 00:00:00 2001 From: Calum Brodie Date: Sun, 21 Apr 2013 20:43:48 +0200 Subject: [PATCH] Update coding standards Removing underscores from property/method names and change use statements to PSR-2 --- ...enting-the-notify-changetracking-policy.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/en/cookbook/implementing-the-notify-changetracking-policy.rst b/docs/en/cookbook/implementing-the-notify-changetracking-policy.rst index a3cc74b8d..b8fd6ff7d 100644 --- a/docs/en/cookbook/implementing-the-notify-changetracking-policy.rst +++ b/docs/en/cookbook/implementing-the-notify-changetracking-policy.rst @@ -22,21 +22,21 @@ implement the ``NotifyPropertyChanged`` interface from the .. code-block:: php _listeners[] = $listener; + $this->listeners[] = $listener; } /** Notifies listeners of a change. */ - protected function _onPropertyChanged($propName, $oldValue, $newValue) { - if ($this->_listeners) { - foreach ($this->_listeners as $listener) { + protected function onPropertyChanged($propName, $oldValue, $newValue) { + if ($this->listeners) { + foreach ($this->listeners as $listener) { $listener->propertyChanged($this, $propName, $oldValue, $newValue); } } @@ -44,7 +44,7 @@ implement the ``NotifyPropertyChanged`` interface from the } Then, in each property setter of concrete, derived domain classes, -you need to invoke \_onPropertyChanged as follows to notify +you need to invoke \onPropertyChanged as follows to notify listeners: .. code-block:: php @@ -58,7 +58,7 @@ listeners: public function setData($data) { if ($data != $this->data) { // check: is it actually modified? - $this->_onPropertyChanged('data', $this->data, $data); + $this->onPropertyChanged('data', $this->data, $data); $this->data = $data; } }