1 | <?php |
||
12 | class PompierService |
||
13 | { |
||
14 | /** |
||
15 | * Initialisation du service avec les repository utilisés. |
||
16 | * |
||
17 | * @param SDIS62\Core\Ops\Repository\PompierRepositoryInterface $pompier_repository |
||
18 | * @param SDIS62\Core\Ops\Repository\CentreRepositoryInterface $centre_repository |
||
19 | */ |
||
20 | public function __construct(PompierRepositoryInterface $pompier_repository, |
||
26 | |||
27 | /** |
||
28 | * Retourne un pompier correspondant au matricule spécifié. |
||
29 | * |
||
30 | * @param string $matricule |
||
31 | * |
||
32 | * @return SDIS62\Core\Ops\Entity\Pompier |
||
33 | */ |
||
34 | public function find($matricule) |
||
38 | |||
39 | /** |
||
40 | * Retourne un pompier correspondant au nom spécifié. |
||
41 | * |
||
42 | * @param string $name |
||
43 | * @param int $count Par défaut: 20 |
||
44 | * @param int $page Par défaut: 1 |
||
45 | * |
||
46 | * @return SDIS62\Core\Ops\Entity\Pompier |
||
47 | */ |
||
48 | public function findAllByName($name, $count = 20, $page = 1) |
||
52 | |||
53 | /** |
||
54 | * Sauvegarde d'un pompier. |
||
55 | * |
||
56 | * @param array $data |
||
57 | * @param array $id_pompier Optionnel |
||
58 | * |
||
59 | * @return SDIS62\Core\Ops\Entity\Pompier |
||
60 | */ |
||
61 | public function save($data) |
||
122 | |||
123 | /** |
||
124 | * Suppression d'un pompier. |
||
125 | * |
||
126 | * @param string $matricule |
||
127 | * |
||
128 | * @return SDIS62\Core\Ops\Entity\Pompier |
||
129 | */ |
||
130 | public function delete($matricule) |
||
142 | } |
||
143 |
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: