Skip to content

Commit

Permalink
ActiveQuery::all - added second argument that will be passed to Comma…
Browse files Browse the repository at this point in the history
…nd::search
  • Loading branch information
SilverFire committed Sep 1, 2015
1 parent 4e30a27 commit 8f703e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/ActiveQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 [];
Expand Down
4 changes: 2 additions & 2 deletions src/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand All @@ -221,6 +222,7 @@ public function load($data = null)
$data = [$data];
}
} elseif ($data['selection']) {
$res = [];
foreach ($data['selection'] as $id) {
$res[$id] = compact('id');
}
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 8f703e7

Please sign in to comment.