From 7ee0315f18c13a7cba1e09e8f9acad1afec21e43 Mon Sep 17 00:00:00 2001 From: Garrus MacTavish Date: Wed, 8 May 2013 01:05:58 +0800 Subject: [PATCH 1/2] descript examples in Yii Framework for 3 patterns --- ChainOfResponsibilities/ChainOfResponsibilities.php | 2 ++ FluentInterface/FluentInterface.php | 1 + Registry/Registry.php | 1 + 3 files changed, 4 insertions(+) diff --git a/ChainOfResponsibilities/ChainOfResponsibilities.php b/ChainOfResponsibilities/ChainOfResponsibilities.php index d8639fc..82ba06e 100644 --- a/ChainOfResponsibilities/ChainOfResponsibilities.php +++ b/ChainOfResponsibilities/ChainOfResponsibilities.php @@ -12,6 +12,8 @@ namespace DesignPatterns; * Examples: * - Caching: first object is an instance of e.g. a Memcached Interface, if that "misses" it delegates the call to the * Database Interface + * - Yii Framework: CFilterChain is a chain of controller action filters. the executing point is passed from one filter + * to the next along the chain, and only if all filters say "yes", the action can be invoked at last. * */ diff --git a/FluentInterface/FluentInterface.php b/FluentInterface/FluentInterface.php index 8d2fff2..c7a7e7a 100644 --- a/FluentInterface/FluentInterface.php +++ b/FluentInterface/FluentInterface.php @@ -11,6 +11,7 @@ namespace DesignPatterns; * Examples: * - Doctrine2's QueryBuilder works something like that example class below * - PHPUnit uses fluent interfaces to build mock objects + * - Yii Framework: CDbCommand and CActiveRecord use this pattern too * */ class SQL diff --git a/Registry/Registry.php b/Registry/Registry.php index 3c79725..0fb4698 100644 --- a/Registry/Registry.php +++ b/Registry/Registry.php @@ -11,6 +11,7 @@ namespace DesignPatterns; * * Example: * - Zend Framework: Zend_Registry holds the application's logger object, front controller etc. + * - Yii Framework: CWebApplication holds all the application components, such as CWebUser, CUrlManager, etc. * */ From 0d35ab368bfb71f2a72c538e9a4d708d51b2f98d Mon Sep 17 00:00:00 2001 From: Garrus MacTavish Date: Wed, 8 May 2013 01:06:11 +0800 Subject: [PATCH 2/2] fix a typo --- Proxy/Proxy.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Proxy/Proxy.php b/Proxy/Proxy.php index 88f13d9..f035e1f 100644 --- a/Proxy/Proxy.php +++ b/Proxy/Proxy.php @@ -55,7 +55,7 @@ class RecordProxy extends Record /** * @var bool */ - protected $_isDirrty = false; + protected $_isDirty = false; /** * @var bool @@ -75,7 +75,7 @@ class RecordProxy extends Record // that extends the Record class if (null !== $data) { $this->_isInitialized = true; - $this->_isDirrty = true; + $this->_isDirty = true; } } @@ -88,7 +88,7 @@ class RecordProxy extends Record */ public function __set($name, $value) { - $this->_isDirrty = true; + $this->_isDirty = true; parent::__set($name, $value); } }