1 | <?php |
||
11 | class InterventionService |
||
12 | { |
||
13 | /** |
||
14 | * Initialisation du service avec les repository utilisés. |
||
15 | * |
||
16 | * @param SDIS62\Core\Ops\Repository\InterventionRepositoryInterface $intervention_repository |
||
17 | * @param SDIS62\Core\Ops\Repository\SinistreRepositoryInterface $sinistre_repository |
||
18 | * @param SDIS62\Core\Ops\Repository\CommuneRepositoryInterface $commune_repository |
||
19 | */ |
||
20 | public function __construct(InterventionRepositoryInterface $intervention_repository, |
||
28 | |||
29 | /** |
||
30 | * Retourne les interventions. |
||
31 | * |
||
32 | * @param int $count Par défaut: 20 |
||
33 | * @param int $page Par défaut: 1 |
||
34 | * |
||
35 | * @return SDIS62\Core\Ops\Entity\Intervention[] |
||
36 | */ |
||
37 | public function getAll($count = 20, $page = 1) |
||
41 | |||
42 | /** |
||
43 | * Retourne une intervention correspondant à l'id spécifié. |
||
44 | * |
||
45 | * @param mixed $id_intervention |
||
46 | * |
||
47 | * @return SDIS62\Core\Ops\Entity\Intervention |
||
48 | */ |
||
49 | public function find($id_intervention) |
||
53 | |||
54 | /** |
||
55 | * Retourne les interventions se trouvant dans un rayon de 500m (par défaut) des coordonnées. |
||
56 | * |
||
57 | * @param float $lat |
||
58 | * @param float $lon |
||
59 | * @param int $distance |
||
60 | * |
||
61 | * @return SDIS62\Core\Ops\Entity\Intervention[] |
||
62 | */ |
||
63 | public function findAllByDistance($lat, $lon, $distance = 500) |
||
67 | |||
68 | /** |
||
69 | * Sauvegarde d'une intervention. |
||
70 | * |
||
71 | * @param array $data |
||
72 | * @param array $id_intervention Optionnel |
||
73 | * |
||
74 | * @return SDIS62\Core\Ops\Entity\Intervention |
||
75 | */ |
||
76 | public function save($data, $id_intervention = null) |
||
126 | |||
127 | /** |
||
128 | * Suppression d'une intervention. |
||
129 | * |
||
130 | * @param mixed $id_intervention |
||
131 | * |
||
132 | * @return SDIS62\Core\Ops\Entity\Intervention |
||
133 | */ |
||
134 | public function delete($id_intervention) |
||
146 | } |
||
147 |
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: