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
  • None
  • system
    • base
    • caching
    • console
    • db
      • ar
      • schema
    • validators
    • web
      • actions
      • auth
      • helpers
      • widgets
        • captcha
        • pagers
  • zii
    • widgets
      • grid

Classes

  • X2DbCriteria
  • Overview
  • Package
  • Class
  • Tree

Class X2DbCriteria

CDbCriteria represents a query criteria, such as conditions, ordering by, limit/offset.

It can be used in AR query methods such as CActiveRecord::find and CActiveRecord::findAll.

$criteria=new CDbCriteria(); $criteria->compare('status',Post::STATUS_ACTIVE); $criteria->addInCondition('id',array(1,2,3,4,5,6));

$posts = Post::model()->findAll($criteria);

CComponent
Extended by CDbCriteria
Extended by X2DbCriteria
Package: system\db\schema
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.0
Located at x2engine/protected/components/X2DbCriteria.php
Methods summary
public static
# compare( string $column, mixed $value, boolean $partialMatch = false, string $operator = 'AND', boolean $escape = true, mixed $ignoreEmpty = true/* x2modend */ )

Modified to allow comparison with empty string. This method is Copyright (c) 2008-2014 by Yii Software LLC http://www.yiiframework.com/license/

Modified to allow comparison with empty string. This method is Copyright (c) 2008-2014 by Yii Software LLC http://www.yiiframework.com/license/

Parameters

$column
string
$column the name of the column to be searched
$value
mixed
$value the column value to be compared with. If the value is a string, the aforementioned intelligent comparison will be conducted. If the value is an array, the comparison is done by exact match of any of the value in the array. If the string or the array is empty, the existing search condition will not be modified.
$partialMatch
boolean
$partialMatch whether the value should consider partial text match (using LIKE and NOT LIKE operators). Defaults to false, meaning exact comparison.
$operator
string
$operator the operator used to concatenate the new condition with the existing one. Defaults to 'AND'.
$escape
boolean
$escape whether the value should be escaped if $partialMatch is true and the value contains characters % or _. When this parameter is true (default), the special characters % (matches 0 or more characters) and _ (matches a single character) will be escaped, and the value will be surrounded with a % character on both ends. When this parameter is false, the value will be directly used for matching without any change.
$ignoreEmpty

Returns

static
the criteria object itself

Overrides

CDbCriteria::compare()
Methods inherited from CDbCriteria
__construct(), __wakeup(), addBetweenCondition(), addColumnCondition(), addCondition(), addInCondition(), addNotInCondition(), addSearchCondition(), mergeWith(), toArray()
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()
Constants inherited from CDbCriteria
PARAM_PREFIX
Properties inherited from CDbCriteria
$alias, $condition, $distinct, $group, $having, $index, $join, $limit, $offset, $order, $paramCount, $params, $scopes, $select, $together, $with
X2CRM Documentation API documentation generated by ApiGen 2.8.0