1 | <?php |
||
9 | class CentreService |
||
10 | { |
||
11 | /** |
||
12 | * Initialisation du service avec les repository utilisés. |
||
13 | * |
||
14 | * @param SDIS62\Core\Ops\Repository\CentreRepositoryInterface $centre_repository |
||
15 | * @param SDIS62\Core\Ops\Repository\CommuneRepositoryInterface $commune_repository |
||
16 | */ |
||
17 | public function __construct(CentreRepositoryInterface $centre_repository, |
||
23 | |||
24 | /** |
||
25 | * Retourne un ensemble de CIS. |
||
26 | * |
||
27 | * @param int $count Par défaut: 20 |
||
28 | * @param int $page Par défaut: 1 |
||
29 | * |
||
30 | * @return SDIS62\Core\User\Entity\Centre[] |
||
31 | */ |
||
32 | public function getAll($count = 20, $page = 1) |
||
36 | |||
37 | /** |
||
38 | * Retourne un CIS correspondant à l'id spécifié. |
||
39 | * |
||
40 | * @param mixed $id_centre |
||
41 | * |
||
42 | * @return SDIS62\Core\Ops\Entity\Centre |
||
43 | */ |
||
44 | public function find($id_centre) |
||
48 | |||
49 | /** |
||
50 | * Retourne des CIS correspondant au nom spécifié. |
||
51 | * |
||
52 | * @param string $name |
||
53 | * @param int $count Par défaut: 20 |
||
54 | * @param int $page Par défaut: 1 |
||
55 | * |
||
56 | * @return SDIS62\Core\Ops\Entity\Centre[] |
||
57 | */ |
||
58 | public function findAllByName($name, $count = 20, $page = 1) |
||
62 | |||
63 | /** |
||
64 | * Sauvegarde d'un centre. |
||
65 | * |
||
66 | * @param array $data |
||
67 | * @param mixed $id_centre Optionnel |
||
68 | * |
||
69 | * @return SDIS62\Core\Ops\Entity\Centre |
||
70 | */ |
||
71 | public function save($data, $id_centre = null) |
||
101 | |||
102 | /** |
||
103 | * Suppression d'un centre. |
||
104 | * |
||
105 | * @param mixed $id_centre |
||
106 | * |
||
107 | * @return SDIS62\Core\Ops\Entity\Centre |
||
108 | */ |
||
109 | public function delete($id_centre) |
||
121 | } |
||
122 |
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: