1 | <?php |
||
10 | class PageService |
||
11 | { |
||
12 | /** |
||
13 | * @var PageRepository |
||
14 | */ |
||
15 | private $pageRepository; |
||
16 | |||
17 | /** |
||
18 | * PageService constructor. |
||
19 | * |
||
20 | * @param PageRepository $pageRepository |
||
21 | */ |
||
22 | public function __construct(PageRepository $pageRepository) |
||
26 | |||
27 | /** |
||
28 | * Fetches a page by slug. |
||
29 | * |
||
30 | * @param array $where |
||
31 | * |
||
32 | * @return null|PageEntity |
||
33 | */ |
||
34 | public function fetchOneBy(array $where = []) |
||
44 | |||
45 | /** |
||
46 | * Creates a page in the database. |
||
47 | * |
||
48 | * @param PageEntity $entity |
||
49 | * |
||
50 | * @return PageEntity |
||
51 | */ |
||
52 | public function create(PageEntity $entity) |
||
56 | |||
57 | /** |
||
58 | * Update a page in the database. |
||
59 | * |
||
60 | * @param PageEntity $entity |
||
61 | * |
||
62 | * @return PageEntity |
||
63 | */ |
||
64 | public function update(PageEntity $entity) |
||
68 | |||
69 | /** |
||
70 | * Removes a page from the database. |
||
71 | * |
||
72 | * @param PageEntity $entity |
||
73 | * |
||
74 | * @return PageEntity |
||
75 | */ |
||
76 | public function remove(PageEntity $entity) |
||
80 | } |
||
81 |