| 1 | <?php |
||
| 12 | class PageService |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var PageRepository |
||
| 16 | */ |
||
| 17 | private $pageRepository; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * PageService constructor. |
||
| 21 | * |
||
| 22 | * @param PageRepository $pageRepository |
||
| 23 | */ |
||
| 24 | public function __construct(PageRepository $pageRepository) |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Fetches a page by slug. |
||
| 31 | * |
||
| 32 | * @param array $where |
||
| 33 | * |
||
| 34 | * @return null|PageEntity |
||
| 35 | */ |
||
| 36 | public function fetchOneBy(array $where = []) |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Creates a page in the database. |
||
| 49 | * |
||
| 50 | * @param PageEntity $entity |
||
| 51 | * |
||
| 52 | * @return PageEntity |
||
| 53 | */ |
||
| 54 | public function create(PageEntity $entity) |
||
| 58 | |||
| 59 | /** |
||
| 60 | * Update a page in the database. |
||
| 61 | * |
||
| 62 | * @param PageEntity $entity |
||
| 63 | * |
||
| 64 | * @return PageEntity |
||
| 65 | */ |
||
| 66 | public function update(PageEntity $entity) |
||
| 70 | |||
| 71 | /** |
||
| 72 | * Removes a page from the database. |
||
| 73 | * |
||
| 74 | * @param PageEntity $entity |
||
| 75 | * |
||
| 76 | * @return PageEntity |
||
| 77 | */ |
||
| 78 | public function remove(PageEntity $entity) |
||
| 82 | } |
||
| 83 |