CDbCriteria
| Package | system.db.schema |
|---|---|
| Inheritance | class CDbCriteria |
| Since | 1.0 |
| Version | $Id: CDbCriteria.php 433 2008-12-30 22:59:17Z qiang.xue $ |
Public Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| condition | string | query condition. | CDbCriteria |
| group | string | how to group the query results. | CDbCriteria |
| having | string | the condition to be applied with GROUP-BY clause. | CDbCriteria |
| join | string | how to join with other tables. | CDbCriteria |
| limit | integer | maximum number of records to be returned. | CDbCriteria |
| offset | integer | zero-based offset from where the records are to be returned. | CDbCriteria |
| order | string | how to sort the query results. | CDbCriteria |
| params | array | list of query parameter values indexed by parameter placeholders. | CDbCriteria |
| select | mixed | the columns being selected. | CDbCriteria |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Constructor. | CDbCriteria |
Property Details
query condition. This refers to the WHERE clause in an SQL statement.
For example, age>31 AND team=1.
how to group the query results. This refers to the GROUP BY clause in an SQL statement.
For example, 'projectID, teamID'.
the condition to be applied with GROUP-BY clause.
For example, 'SUM(revenue)<50000'.
how to join with other tables. This refers to the JOIN clause in an SQL statement.
For example, 'LEFT JOIN users ON users.id=authorID'.
maximum number of records to be returned. If less than 0, it means no limit.
zero-based offset from where the records are to be returned. If less than 0, it means starting from the beginning.
how to sort the query results. This refers to the ORDER BY clause in an SQL statement.
list of query parameter values indexed by parameter placeholders.
For example, array(':name'=>'Dan', ':age'=>31).
the columns being selected. This refers to the SELECT clause in an SQL statement. The property can be either a string (column names separated by commas) or an array of column names. Defaults to '*', meaning all columns.
Method Details
|
public void __construct(array $data=array (
))
| ||
| $data | array | criteria initial property values (indexed by property name) |
Constructor.