1 | <?php |
||
11 | class MaterielService |
||
12 | { |
||
13 | /** |
||
14 | * Initialisation du service avec les repository utilisés. |
||
15 | * |
||
16 | * @param SDIS62\Core\Ops\Repository\MaterielRepositoryInterface $materiel_repository |
||
17 | * @param SDIS62\Core\Ops\Repository\CentreRepositoryInterface $centre_repository |
||
18 | */ |
||
19 | public function __construct(MaterielRepositoryInterface $materiel_repository, |
||
25 | |||
26 | /** |
||
27 | * Retourne un matériel correspondant à l'id spécifié. |
||
28 | * |
||
29 | * @param mixed $id_materiel |
||
30 | * |
||
31 | * @return SDIS62\Core\Ops\Entity\Materiel |
||
32 | */ |
||
33 | public function find($id_materiel) |
||
37 | |||
38 | /** |
||
39 | * Sauvegarde d'un matériel. |
||
40 | * |
||
41 | * @param array $data |
||
42 | * @param array $id_materiel Optionnel |
||
43 | * |
||
44 | * @return SDIS62\Core\Ops\Entity\Centre |
||
45 | */ |
||
46 | public function save($data, $id_materiel = null) |
||
76 | |||
77 | /** |
||
78 | * Suppression d'un matériel. |
||
79 | * |
||
80 | * @param mixed $id_materiel |
||
81 | * |
||
82 | * @return SDIS62\Core\Ops\Entity\Materiel |
||
83 | */ |
||
84 | public function delete($id_materiel) |
||
96 | } |
||
97 |
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: