lithium\data\model\Query::childs()
Get/set sub queries for the query.
The getter must be called after an export since the sub queries are built
during the export according the export's mode option and the query with option.
Parameters
-
string
$relpatha dotted relation path
-
string
$querya query instance
Returns
mixedSource
public function childs($relpath = null, $query = null) {
if (!$model = $this->model()) {
throw new ConfigException('No bound model.');
}
if ($query) {
$this->_childs[$relpath] = $query;
return $this;
}
return $this->_childs;
}