1 | <?php |
||
8 | class SinistreService |
||
9 | { |
||
10 | /** |
||
11 | * Initialisation du service avec les repository utilisés. |
||
12 | * |
||
13 | * @param SDIS62\Core\Ops\Repository\SinistreRepositoryInterface $sinistre_repository |
||
14 | */ |
||
15 | public function __construct(SinistreRepositoryInterface $sinistre_repository) |
||
19 | |||
20 | /** |
||
21 | * Retourne un ensemble de sinistre. |
||
22 | * |
||
23 | * @param int $count Par défaut: 20 |
||
24 | * @param int $page Par défaut: 1 |
||
25 | * |
||
26 | * @return SDIS62\Core\User\Entity\Sinistre[] |
||
27 | */ |
||
28 | public function getAll($count = 20, $page = 1) |
||
32 | |||
33 | /** |
||
34 | * Retourne un sinistre correspondant à l'id spécifié. |
||
35 | * |
||
36 | * @param mixed $id_sinistre |
||
37 | * |
||
38 | * @return SDIS62\Core\Ops\Entity\Sinistre |
||
39 | */ |
||
40 | public function find($id_sinistre) |
||
44 | |||
45 | /** |
||
46 | * Sauvegarde d'un sinistre. |
||
47 | * |
||
48 | * @param array $data |
||
49 | * @param array $id_sinistre Optionnel |
||
50 | * |
||
51 | * @return SDIS62\Core\Ops\Entity\Sinistre |
||
52 | */ |
||
53 | public function save($data, $id_sinistre = null) |
||
65 | |||
66 | /** |
||
67 | * Suppression d'un sinistre. |
||
68 | * |
||
69 | * @param mixed $id_sinistre |
||
70 | * |
||
71 | * @return SDIS62\Core\Ops\Entity\Sinistre |
||
72 | */ |
||
73 | public function delete($id_sinistre) |
||
85 | } |
||
86 |
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: