1 | <?php |
||
7 | class Commune |
||
8 | { |
||
9 | protected $name; |
||
10 | protected $zipcode; |
||
11 | protected $departement; |
||
12 | |||
13 | function __construct($name, $zipcode, Departement $departement) { |
||
18 | |||
19 | public function getName() |
||
23 | |||
24 | public function setName($name) |
||
28 | |||
29 | public function getZipcode() |
||
33 | |||
34 | public function setZipcode($zipcode) |
||
38 | |||
39 | public function getDepartement() |
||
43 | |||
44 | public function setDepartement(Departement $departement) |
||
48 | } |
||
49 | |||
50 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.