Populates or adds parts to current query clauses using an array.
This is handy for passing all query clauses at once. The option array accepts:
- fields: Maps to the select method
- conditions: Maps to the where method
- limit: Maps to the limit method
- order: Maps to the order method
- offset: Maps to the offset method
- group: Maps to the group method
- having: Maps to the having method
- contain: Maps to the contain options for eager loading
- join: Maps to the join method
- page: Maps to the page method
### Example:
$query->applyOptions([
'fields' => ['id', 'name'],
'conditions' => [
'created >=' => '2013-01-01'
],
'limit' => 10
]);
Is equivalent to:
$query
->select(['id', 'name'])
->where(['created >=' => '2013-01-01'])
->limit(10)
public applyOptions ( array $options ) | ||
$options | array |