| 1 | <?php |
||
| 8 | class Departement |
||
| 9 | { |
||
| 10 | protected $name; |
||
| 11 | protected $code; |
||
| 12 | protected $region; |
||
| 13 | protected $communes; |
||
| 14 | |||
| 15 | function __construct () { |
||
| 18 | |||
| 19 | public function getName() |
||
| 23 | |||
| 24 | public function setName($name) |
||
| 29 | |||
| 30 | public function getCode() |
||
| 34 | |||
| 35 | public function setCode($code) |
||
| 40 | |||
| 41 | public function getRegion() |
||
| 45 | |||
| 46 | public function setRegion(Region $region) |
||
| 51 | |||
| 52 | public function getCommunes() |
||
| 56 | |||
| 57 | public function addCommune(Commune $commune) { |
||
| 60 | |||
| 61 | public function setCommunes(SequenceInterface $communes) |
||
| 65 | |||
| 66 | public function __toString() |
||
| 70 | |||
| 71 | } |
||
| 72 | |||
| 73 |
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.