Browse Source
Added `QueryInterface::emulateExecution()`, which allows preventing of the actual query execution. This allows to cancel `DataProvider` preventing search query execution in case search model is invalid: ``` php public function search($params) { $query = Item::find(); $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); $this->load($params); if (!$this->validate()) { $query->where('0=1'); $query->emulateExecution(); // No SQL execution will be done return $dataProvider; } ``` This also fix unecessary query in case of `via()` usage. See #12390. fixes #12390 fixes #6373 close #12708tags/2.0.11
Klimov Paul
8 years ago
committed by
Carsten Brandt
8 changed files with 215 additions and 2 deletions
Loading…
Reference in new issue