Skip to content

Commit

Permalink
move method
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Nov 26, 2016
1 parent 7b54ffa commit 872ca77
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/Illuminate/Database/Eloquent/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,23 +185,6 @@ public function findMany($ids, $columns = ['*'])
return $this->whereKey($ids)->get($columns);
}

/**
* Add where clause with primary key to the query.
*
* @param mixed $id
* @return $this
*/
public function whereKey($id)
{
if (is_array($id)) {
$this->query->whereIn($this->model->getQualifiedKeyName(), $id);

return $this;
}

return $this->where($this->model->getQualifiedKeyName(), '=', $id);
}

/**
* Find a model by its primary key or throw an exception.
*
Expand Down Expand Up @@ -819,6 +802,23 @@ public function when($value, $callback, $default = null)
return $builder;
}

/**
* Add a where clause on the primary key to the query.
*
* @param mixed $id
* @return $this
*/
public function whereKey($id)
{
if (is_array($id)) {
$this->query->whereIn($this->model->getQualifiedKeyName(), $id);

return $this;
}

return $this->where($this->model->getQualifiedKeyName(), '=', $id);
}

/**
* Add a basic where clause to the query.
*
Expand Down

0 comments on commit 872ca77

Please sign in to comment.