| Total Complexity | 6 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class HtmlBlockRepository extends BaseRepository |
||
| 9 | { |
||
| 10 | protected $model; |
||
| 11 | |||
| 12 | public function __construct(HtmlBlock $model) |
||
| 13 | { |
||
| 14 | $this->model = $model; |
||
| 15 | } |
||
| 16 | |||
| 17 | function selectAllActiveByShopId($shopId) |
||
|
|
|||
| 18 | { |
||
| 19 | return $this->model->where('shop_id', $shopId)->get(); |
||
| 20 | } |
||
| 21 | |||
| 22 | function selectOneByShopIdAndSlug($shopId, $slug) |
||
| 23 | { |
||
| 24 | $result = $this->model->where('shop_id', $shopId)->where('slug', $slug)->get(); |
||
| 25 | |||
| 26 | if ($result->isEmpty()) { |
||
| 27 | return false; |
||
| 28 | } |
||
| 29 | return $result->first(); |
||
| 30 | } |
||
| 31 | |||
| 32 | public function selectOneByShopIdAndPosition($position, $shopId) |
||
| 40 | } |
||
| 41 | } |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.