Unverified Commit 928a4aa2 authored by Nicolas Widart's avatar Nicolas Widart Committed by GitHub

Merge pull request #645 from xfudox/pull_requests/whereIn

added whereIn() method to interface, eloquent repo and cache decorator
parents f6df9b81 66722138
...@@ -114,4 +114,11 @@ interface BaseRepository ...@@ -114,4 +114,11 @@ interface BaseRepository
* @param array|string $relationships * @param array|string $relationships
*/ */
public function with($relationships); public function with($relationships);
/**
* @param string $field
* @param array $values
* @return Builder;
*/
public function whereIn(string $field, array $values) : Builder;
} }
...@@ -221,6 +221,14 @@ abstract class BaseCacheDecorator implements BaseRepository ...@@ -221,6 +221,14 @@ abstract class BaseCacheDecorator implements BaseRepository
); );
} }
/**
* @inheritdoc
*/
public function whereIn(string $field, array $values) : Builder
{
return $this->repository->whereIn($field, $values);
}
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -213,4 +213,12 @@ abstract class EloquentBaseRepository implements BaseRepository ...@@ -213,4 +213,12 @@ abstract class EloquentBaseRepository implements BaseRepository
{ {
return $this->model->with($relationships); return $this->model->with($relationships);
} }
/**
* @inheritdoc
*/
public function whereIn(string $field, array $values) : Builder
{
return $this->model->whereIn($field, $values);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment