LIMIT is not working in ActiveDataProvider

Here is what happens when preparing models in yii\data\ActiveDataProvider: /** * @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) { … Read more