mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-07 15:36:34 +02:00
Merge pull request #3 from garrus/master
Added examples in Yii Framework
This commit is contained in:
@@ -12,6 +12,8 @@ namespace DesignPatterns;
|
|||||||
* Examples:
|
* Examples:
|
||||||
* - Caching: first object is an instance of e.g. a Memcached Interface, if that "misses" it delegates the call to the
|
* - Caching: first object is an instance of e.g. a Memcached Interface, if that "misses" it delegates the call to the
|
||||||
* Database Interface
|
* 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.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -11,6 +11,7 @@ namespace DesignPatterns;
|
|||||||
* Examples:
|
* Examples:
|
||||||
* - Doctrine2's QueryBuilder works something like that example class below
|
* - Doctrine2's QueryBuilder works something like that example class below
|
||||||
* - PHPUnit uses fluent interfaces to build mock objects
|
* - PHPUnit uses fluent interfaces to build mock objects
|
||||||
|
* - Yii Framework: CDbCommand and CActiveRecord use this pattern too
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class SQL
|
class SQL
|
||||||
|
@@ -55,7 +55,7 @@ class RecordProxy extends Record
|
|||||||
/**
|
/**
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
protected $_isDirrty = false;
|
protected $_isDirty = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var bool
|
* @var bool
|
||||||
@@ -75,7 +75,7 @@ class RecordProxy extends Record
|
|||||||
// that extends the Record class
|
// that extends the Record class
|
||||||
if (null !== $data) {
|
if (null !== $data) {
|
||||||
$this->_isInitialized = true;
|
$this->_isInitialized = true;
|
||||||
$this->_isDirrty = true;
|
$this->_isDirty = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ class RecordProxy extends Record
|
|||||||
*/
|
*/
|
||||||
public function __set($name, $value)
|
public function __set($name, $value)
|
||||||
{
|
{
|
||||||
$this->_isDirrty = true;
|
$this->_isDirty = true;
|
||||||
parent::__set($name, $value);
|
parent::__set($name, $value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -11,6 +11,7 @@ namespace DesignPatterns;
|
|||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* - Zend Framework: Zend_Registry holds the application's logger object, front controller etc.
|
* - 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.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user