Commit 602a2134 authored by Silvio Gratani's avatar Silvio Gratani

added whereIn() method to interface, eloquent repo and cache decorator

parent 24d1aeb2
......@@ -98,4 +98,10 @@ interface BaseRepository
* @return bool
*/
public function clearCache();
/**
* @param string $field
* @param array $values
*/
public function whereIn(string $field, array $values);
}
......@@ -220,4 +220,15 @@ abstract class BaseCacheDecorator implements BaseRepository
$this->entityName
);
}
/**
* @param string $field
* @param array $values
*/
public function whereIn(string $field, array $values)
{
return $this->remember(function () use ($field, $values) {
return $this->repository->whereIn($field, $values);
});
}
}
......@@ -191,4 +191,13 @@ abstract class EloquentBaseRepository implements BaseRepository
{
return true;
}
/**
* @param string $field
* @param array $values
*/
public function whereIn(string $field, array $values)
{
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