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

Class CDbCacheDependency

CDbCacheDependency represents a dependency based on the query result of a SQL statement.

If the query result (a scalar) changes, the dependency is considered as changed. To specify the SQL statement, set CDbCacheDependency::$sql property. The CDbCacheDependency::$connectionID property specifies the ID of a CDbConnection application component. It is this DB connection that is used to perform the query.

CComponent
Extended by CCacheDependency implements ICacheDependency
Extended by CDbCacheDependency
Package: system\caching\dependencies
Copyright: 2008-2013 Yii Software LLC
License: http://www.yiiframework.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.0
Located at x2engine/framework/caching/dependencies/CDbCacheDependency.php
Methods summary
public
# __construct( string $sql = null )

Constructor.

Constructor.

Parameters

$sql
string
$sql the SQL statement whose result is used to determine if the dependency has been changed.
public array
# __sleep( )

PHP sleep magic method. This method ensures that the database instance is set null because it contains resource handles.

PHP sleep magic method. This method ensures that the database instance is set null because it contains resource handles.

Returns

array
protected mixed
# generateDependentData( )

Generates the data needed to determine if dependency has been changed. This method returns the value of the global state.

Generates the data needed to determine if dependency has been changed. This method returns the value of the global state.

Returns

mixed
the data needed to determine if dependency has been changed.

Throws

CException
if CDbCacheDependency::$sql is empty

Overrides

CCacheDependency::generateDependentData()
protected CDbConnection
# getDbConnection( )

Returns

CDbConnection
the DB connection instance

Throws

CException
if CDbCacheDependency::$connectionID does not point to a valid application component.
Methods inherited from CCacheDependency
evaluateDependency(), getDependentData(), getHasChanged(), resetReusableData()
Methods inherited from CComponent
__call(), __get(), __isset(), __set(), __unset(), asa(), attachBehavior(), attachBehaviors(), attachEventHandler(), canGetProperty(), canSetProperty(), detachBehavior(), detachBehaviors(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), getEventHandlers(), hasEvent(), hasEventHandler(), hasProperty(), raiseEvent()
Properties summary
public string $connectionID 'db'
#

the ID of a CDbConnection application component. Defaults to 'db'.

the ID of a CDbConnection application component. Defaults to 'db'.

public string $sql
#

the SQL statement whose result is used to determine if the dependency has been changed. Note, the SQL statement should return back a single value.

the SQL statement whose result is used to determine if the dependency has been changed. Note, the SQL statement should return back a single value.

public array $params
#

parameters (name=>value) to be bound to the SQL statement specified by CDbCacheDependency::$sql.

parameters (name=>value) to be bound to the SQL statement specified by CDbCacheDependency::$sql.

Since

1.1.4
Properties inherited from CCacheDependency
$reuseDependentData
Magic properties inherited from CCacheDependency
$dependentData, $hasChanged
API documentation generated by ApiGen 2.8.0