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

  • CDbColumnSchema
  • CDbCommandBuilder
  • CDbCriteria
  • CDbExpression
  • CDbSchema
  • CDbTableSchema
  • X2DbCriteria
  • Overview
  • Package
  • Class
  • Tree

Class CDbExpression

CDbExpression represents a DB expression that does not need escaping. CDbExpression is mainly used in CActiveRecord as attribute values. When inserting or updating a CActiveRecord, attribute values of type CDbExpression will be directly put into the corresponding SQL statement without escaping. A typical usage is that an attribute is set with 'NOW()' expression so that saving the record would fill the corresponding column with the current DB server timestamp.

Starting from version 1.1.1, one can also specify parameters to be bound for the expression. For example, if the expression is 'LOWER(:value)', then one can set CDbExpression::$params to be <span class="php-keyword1">array</span>(<span class="php-quote">':value'</span>=><span class="php-var">$value</span>).

CComponent
Extended by CDbExpression
Package: system\db\schema
Copyright: 2008-2013 Yii Software LLC
License: http://www.yiiframework.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Located at x2engine/framework/db/schema/CDbExpression.php
Methods summary
public
# __construct( string $expression, array $params = array() )

Constructor.

Constructor.

Parameters

$expression
string
$expression the DB expression
$params
array
$params parameters
public string
# __toString( )

String magic method

String magic method

Returns

string
the DB expression
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 $expression
#

the DB expression

the DB expression

public array $params array()
#

list of parameters that should be bound for this expression. The keys are placeholders appearing in CDbExpression::$expression, while the values are the corresponding parameter values.

list of parameters that should be bound for this expression. The keys are placeholders appearing in CDbExpression::$expression, while the values are the corresponding parameter values.

Since

1.1.1
API documentation generated by ApiGen 2.8.0