| 1 | <?php |
||
| 11 | class BlockService |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var BlockRepository |
||
| 15 | */ |
||
| 16 | private $blockRepository; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * BlockService constructor. |
||
| 20 | * |
||
| 21 | * @param BlockRepository $blockRepository |
||
| 22 | */ |
||
| 23 | public function __construct(BlockRepository $blockRepository) |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Fetch by. |
||
| 30 | * |
||
| 31 | * @param array $where |
||
| 32 | * |
||
| 33 | * @return BlockEntity[] |
||
| 34 | */ |
||
| 35 | public function fetchBy(array $where = []) |
||
| 36 | { |
||
| 37 | return $this->blockRepository->fetchBy($where); |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Creates a page in the database. |
||
| 42 | * |
||
| 43 | * @param BlockEntity $entity |
||
| 44 | * |
||
| 45 | * @return BlockEntity |
||
| 46 | */ |
||
| 47 | public function create(BlockEntity $entity) |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Update a page in the database. |
||
| 54 | * |
||
| 55 | * @param BlockEntity $entity |
||
| 56 | * |
||
| 57 | * @return BlockEntity |
||
| 58 | */ |
||
| 59 | public function update(BlockEntity $entity) |
||
| 63 | |||
| 64 | /** |
||
| 65 | * Removes a page from the database. |
||
| 66 | * |
||
| 67 | * @param BlockEntity $entity |
||
| 68 | * |
||
| 69 | * @return BlockEntity |
||
| 70 | */ |
||
| 71 | public function remove(BlockEntity $entity) |
||
| 75 | } |
||
| 76 |