lithium\data\model\Query::__construct PHP Method

__construct() public method

This means that any information may be passed into the constructor may be used by the backend data source executing the query (or ignored, if support is not implemented). This is useful if, for example, you wish to extend a core data source and implement custom functionality.
public __construct ( array $config = [] ) : void
$config array Available configuration options are: - `'type'` _string_: The type of the query (`read`, `create`, `update`, `delete`). - `'mode'` _string_: `JOIN` mode for a join query. - `'entity'` _object_: The base entity to query on. If set `'model'` is optionnal. - `'model'` _string_: The base model to query on. - `'source'` _string_: The name of the table/collection. Unnecessary if `model` is set. - `'alias'` _string_: Alias for the source. Unnecessary if `model` is set. - `'schema'` _object_: A schema model. Unnecessary if `model` is set. - `'fields'` _array_: The fields to retreive. - `'conditions'` _array_: The conditions of the queries - `'having'` _array_: The having conditions of the queries - `'group'` _string_: The group by parameter. - `'order'` _string_: The order by parameter. - `'limit'` _string_: The limit parameter. - `'offset'` _string_: The offset of the `limit` options. - `'page'` _string_: Convenience parameter for setting the `offset`: `offset` = `page` * `limit`. - `'with'` _array_: Contain dependencies. Works only if `model` is set. - `'joins'` _array_: Contain manual join dependencies. - `'data'` _array_: Datas for update queries. - `'whitelist'` _array_: Allowed fields for updating queries. - `'calculate'` _string_: Alias name of the count. - `'comment'` _string_: Comment for the query. - `'map'` _object_: Unnecessary if `model` is set. - `'relationships'` _array_: Unnecessary if `model` is set.
return void
    public function __construct(array $config = array())
    {
        $defaults = array('type' => 'read', 'mode' => null, 'model' => null, 'entity' => null, 'source' => null, 'alias' => null, 'fields' => array(), 'conditions' => array(), 'having' => array(), 'group' => null, 'order' => null, 'limit' => null, 'offset' => null, 'page' => null, 'with' => array(), 'joins' => array(), 'data' => array(), 'whitelist' => array(), 'calculate' => null, 'schema' => null, 'comment' => null, 'map' => array(), 'relationships' => array());
        parent::__construct($config + $defaults);
    }