lithium\data\model\Query::conditions()
Set or append to existing conditions, or get current conditions.
When getting current conditions and none are configured for the query, will ask the bound entity for its conditions instead.
Parameters
-
string|array|null
$conditions
Condition/s to append to existing conditions. Provide
null
to get current conditions.
Returns
string|QueryEither the currrent conditions when $conditions is
null
or the query itself when setting the conditions.
Source
public function conditions($conditions = null) {
if (!$conditions) {
return $this->_config['conditions'] ?: $this->_entityConditions();
}
$this->_config['conditions'] = array_merge(
(array) $this->_config['conditions'], (array) $conditions
);
return $this;
}