1 | <?php |
||
10 | class EvenementService |
||
11 | { |
||
12 | /** |
||
13 | * Initialisation du service avec les repository utilisés. |
||
14 | * |
||
15 | * @param SDIS62\Core\Ops\Repository\EvenementRepositoryInterface $evenement_repository |
||
16 | * @param SDIS62\Core\Ops\Repository\InterventionRepositoryInterface $intervention_repository |
||
17 | */ |
||
18 | public function __construct(EvenementRepositoryInterface $evenement_repository, |
||
26 | |||
27 | /** |
||
28 | * Retourne un évenement. |
||
29 | * |
||
30 | * @param mixed $id_evenement |
||
31 | * |
||
32 | * @return SDIS62\Core\Ops\Entity\Evenement |
||
33 | */ |
||
34 | public function find($id_evenement) |
||
38 | |||
39 | /** |
||
40 | * Création d'un evenement sur une intervention. |
||
41 | * |
||
42 | * @param string $type |
||
43 | * @param array $data |
||
44 | * |
||
45 | * @return SDIS62\Core\Ops\Entity\Evenement |
||
46 | */ |
||
47 | public function create($type, $data) |
||
70 | |||
71 | /** |
||
72 | * Suppression d'un evenement. |
||
73 | * |
||
74 | * @param mixed $id_evenement |
||
75 | * |
||
76 | * @return SDIS62\Core\Ops\Entity\Evenement |
||
77 | */ |
||
78 | public function delete($id_evenement) |
||
90 | } |
||
91 |
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: