Код: Выделить всё
/**
* {@inheritdoc}
*/
protected function prepareModels()
{
if (!$this->query instanceof QueryInterface) {
throw new InvalidConfigException('The "query" property must be an instance of a class that implements the QueryInterface e.g. yii\db\Query or its subclasses.');
}
$query = clone $this->query;
if (($pagination = $this->getPagination()) !== false) {
$pagination->totalCount = $this->getTotalCount();
if ($pagination->totalCount === 0) {
return [];
}
$query->limit($pagination->getLimit())->offset($pagination->getOffset());
}
if (($sort = $this->getSort()) !== false) {
$query->addOrderBy($sort->getOrders());
}
return $query->all($this->db);
}
Код: Выделить всё
Model::find()->active()
Код: Выделить всё
Repository->findActive()
Как мне в таком случае выстраивать адаптивный Repository? Тупо повторять все методы AQ? Или есть другие способы? Так же инетерсует про жадную загрузку...
...Код: Выделить всё
width('user')
Помогите, пожалуйста......