CBaseActiveRelation
CBaseActiveRelation is the base class for all active relations.
Public Properties
Hide inherited properties
| Property | Type | Description | Defined By |
| className |
string |
name of the related active record class |
CBaseActiveRelation |
| condition |
string |
WHERE clause. |
CBaseActiveRelation |
| foreignKey |
string |
the foreign key in this relation |
CBaseActiveRelation |
| group |
string |
GROUP BY clause. |
CBaseActiveRelation |
| having |
string |
HAVING clause. |
CBaseActiveRelation |
| name |
string |
name of the related object |
CBaseActiveRelation |
| order |
string |
ORDER BY clause. |
CBaseActiveRelation |
| params |
array |
the parameters that are to be bound to the condition. |
CBaseActiveRelation |
| select |
mixed |
list of column names (an array, or a string of names separated by commas) to be selected. |
CBaseActiveRelation |
Property Details
public string $className;
name of the related active record class
public string $condition;
WHERE clause. For CActiveRelation descendant classes, column names
referenced in the condition should be disambiguated with prefix '??.'.
public string $foreignKey;
the foreign key in this relation
public string $group;
GROUP BY clause. For CActiveRelation descendant classes, column names
referenced in this property should be disambiguated with prefix '??.'.
public string $having;
HAVING clause. For CActiveRelation descendant classes, column names
referenced in this property should be disambiguated with prefix '??.'.
public string $name;
name of the related object
public string $order;
ORDER BY clause. For CActiveRelation descendant classes, column names
referenced in this property should be disambiguated with prefix '??.'.
public array $params;
the parameters that are to be bound to the condition.
The keys are parameter placeholder names, and the values are parameter values.
public mixed $select;
list of column names (an array, or a string of names separated by commas) to be selected.
Do not quote or prefix the column names unless they are used in an expression.
In that case, you should prefix the column names with '??.'.
Method Details
|
public void __construct(string $name, string $className, string $foreignKey, array $options=array (
))
|
| $name |
string |
name of the relation |
| $className |
string |
name of the related active record class |
| $foreignKey |
string |
foreign key for this relation |
| $options |
array |
additional options (name=>value). The keys must be the property names of this class. |
Constructor.
|
public void mergeWith(array $criteria)
|
| $criteria |
array |
the dynamically specified criteria |
Merges this relation with a criteria specified dynamically.