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
- CDbExpression
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
public
|
|
public
string
|
public
string
|
$expression |
|
#
the DB expression |
public
array
|
$params | array() |
#
list of parameters that should be bound for this expression. The keys are
placeholders appearing in |