diff --git a/src/ActiveQuery.php b/src/ActiveQuery.php index e3d149c..699e06d 100644 --- a/src/ActiveQuery.php +++ b/src/ActiveQuery.php @@ -106,16 +106,17 @@ public function createCommand($db = null) * @param Connection $db the DB connection used to create the DB command. * If null, the DB connection returned by [[modelClass]] will be used. * + * @param array $options Options that will be passed to search command * @return array the query results. If the query results in nothing, an empty array will be returned. */ - public function all($db = null) + public function all($db = null, $options = []) { if ($this->asArray) { // TODO implement with return parent::all($db); } - $result = $this->createCommand($db)->search(); + $result = $this->createCommand($db)->search($options); if (empty($result)) { return []; diff --git a/src/Collection.php b/src/Collection.php index c3bb9fa..85491dd 100644 --- a/src/Collection.php +++ b/src/Collection.php @@ -206,6 +206,7 @@ public function load($data = null) if ($data === null) { $data = Yii::$app->request->post(); + if (isset($data[$this->formName])) { $data = $data[$this->formName]; @@ -221,6 +222,7 @@ public function load($data = null) $data = [$data]; } } elseif ($data['selection']) { + $res = []; foreach ($data['selection'] as $id) { $res[$id] = compact('id'); } @@ -385,8 +387,6 @@ public function update($runValidation = true, $attributes = null, $options = []) public function delete() { - \yii\helpers\VarDumper::dump(1, 10, true); - die(); $result = false; if ($this->beforeDelete()) { $data = $this->collectData();