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
$relpath
a dotted relation path
-
string
$query
a query instance
Returns
mixedSource
public function childs($relpath = null, $query = null) {
if (!$model = $this->model()) {
throw new ConfigException("No binded model.");
}
if ($query) {
$this->_childs[$relpath] = $query;
return $this;
}
return $this->_childs;
}