Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • Net
  • None
  • PHP
  • system
    • base
    • caching
      • dependencies
    • collections
    • console
    • db
      • ar
      • schema
        • cubrid
        • mssql
        • mysql
        • oci
        • pgsql
        • sqlite
    • i18n
      • gettext
    • logging
    • test
    • utils
    • validators
    • web
      • actions
      • auth
      • filters
      • form
      • helpers
      • renderers
      • services
      • widgets
        • captcha
        • pagers
  • Text
    • Highlighter
  • zii
    • behaviors
    • widgets
      • grid
      • jui

Classes

  • CCacheDependency
  • CChainedCacheDependency
  • CDbCacheDependency
  • CDirectoryCacheDependency
  • CExpressionDependency
  • CFileCacheDependency
  • CGlobalStateCacheDependency
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * CExpressionDependency class file.
 4:  *
 5:  * @author Qiang Xue <qiang.xue@gmail.com>
 6:  * @link http://www.yiiframework.com/
 7:  * @copyright 2008-2013 Yii Software LLC
 8:  * @license http://www.yiiframework.com/license/
 9:  */
10: 
11: /**
12:  * CExpressionDependency represents a dependency based on the result of a PHP expression.
13:  *
14:  * CExpressionDependency performs dependency checking based on the
15:  * result of a PHP {@link expression}.
16:  * The dependency is reported as unchanged if and only if the result is
17:  * the same as the one evaluated when storing the data to cache.
18:  *
19:  * @author Qiang Xue <qiang.xue@gmail.com>
20:  * @package system.caching.dependencies
21:  * @since 1.0
22:  */
23: class CExpressionDependency extends CCacheDependency
24: {
25:     /**
26:      * @var string the PHP expression whose result is used to determine the dependency.
27:      * The expression can also be a valid serializable PHP callback.
28:      * It will be passed with a parameter which is the dependency object itself.
29:      *
30:      * The PHP expression will be evaluated using {@link evaluateExpression}.
31:      *
32:      * A PHP expression can be any PHP code that has a value. To learn more about what an expression is,
33:      * please refer to the {@link http://www.php.net/manual/en/language.expressions.php php manual}.
34:      */
35:     public $expression;
36: 
37:     /**
38:      * Constructor.
39:      * @param string $expression the PHP expression whose result is used to determine the dependency.
40:      */
41:     public function __construct($expression='true')
42:     {
43:         $this->expression=$expression;
44:     }
45: 
46:     /**
47:      * Generates the data needed to determine if dependency has been changed.
48:      * This method returns the result of the PHP expression.
49:      * @return mixed the data needed to determine if dependency has been changed.
50:      */
51:     protected function generateDependentData()
52:     {
53:         return $this->evaluateExpression($this->expression);
54:     }
55: }
56: 
API documentation generated by ApiGen 2.8.0