Skip to content

Commit

Permalink
breaking change findWhere() now return to $this
Browse files Browse the repository at this point in the history
  • Loading branch information
agungsugiarto committed Aug 25, 2020
1 parent cc90046 commit 7c38b48
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
5 changes: 2 additions & 3 deletions src/Contracts/RepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ public function find($id, $columns = ['*']);
* Add basic where clauses and execute the query.
*
* @param array $conditions
* @param array $columns
* @return array
* @return $this
*/
public function findWhere(array $conditions, array $columns = ['*']);
public function findWhere(array $conditions);

/**
* Paginate the given query.
Expand Down
11 changes: 6 additions & 5 deletions src/Eloquent/BaseRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,15 @@ public function find($id, $columns = ['*'])
* Add basic where clauses and execute the query.
*
* @param array $conditions
* @param array $columns
* @return array
* @return $this
*/
public function findWhere(array $conditions, array $columns = ['*'])
public function findWhere(array $conditions)
{
return $this->withCriteria([
$this->withCriteria([
new FindWhere($conditions)
])->get($columns);
]);

return $this;
}

/**
Expand Down

0 comments on commit 7c38b48

Please sign in to comment.