1 | <?php |
||
9 | class PlanningService |
||
10 | { |
||
11 | /** |
||
12 | * Initialisation du service avec les repository utilisés. |
||
13 | * |
||
14 | * @param SDIS62\Core\Ops\Repository\PlanningRepositoryInterface $planning_repository |
||
15 | */ |
||
16 | public function __construct(PlanningRepositoryInterface $planning_repository) |
||
20 | |||
21 | /** |
||
22 | * Retourne un planning à l'id spécifié. |
||
23 | * |
||
24 | * @param mixed $id_planning |
||
25 | * |
||
26 | * @return SDIS62\Core\Ops\Entity\Planning |
||
27 | */ |
||
28 | public function find($id_planning) |
||
32 | |||
33 | /** |
||
34 | * Retourne le planning entre les dates données. |
||
35 | * |
||
36 | * @param mixed $id_planning |
||
37 | * @param Datetime $start |
||
38 | * @param Datetime $end |
||
39 | * |
||
40 | * @return SDIS62\Core\User\Entity\Planning |
||
41 | */ |
||
42 | public function findByPeriod($id_planning, Datetime $start, Datetime $end) |
||
46 | |||
47 | /** |
||
48 | * Sauvegarde du planning. |
||
49 | * |
||
50 | * @param array $data |
||
51 | * @param array $id_planning |
||
52 | * |
||
53 | * @return SDIS62\Core\Ops\Entity\Planning |
||
54 | */ |
||
55 | public function save($data, $id_planning = null) |
||
67 | |||
68 | /** |
||
69 | * Suppression d'un planning. |
||
70 | * |
||
71 | * @param mixed $id_planning |
||
72 | * |
||
73 | * @return SDIS62\Core\Ops\Entity\Planning |
||
74 | */ |
||
75 | public function delete($id_planning) |
||
87 | } |
||
88 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: