1 | <?php |
||
17 | class UserAddress extends \SimpleORM\AbstractEntity { |
||
18 | |||
19 | protected $code; |
||
20 | |||
21 | protected $street; |
||
22 | |||
23 | protected $city; |
||
24 | |||
25 | function __construct(City $City,$code,$street) { |
||
|
|||
26 | $this->setCity($City); |
||
27 | $this->setCode($code); |
||
28 | $this->setStreet($street); |
||
29 | } |
||
30 | |||
31 | function getCode() { |
||
34 | |||
35 | function getStreet() { |
||
38 | |||
39 | function getCity() { |
||
42 | |||
43 | function setCode($code) { |
||
46 | |||
47 | function setStreet($street) { |
||
50 | |||
51 | function setCity(City $city) { |
||
54 | |||
55 | |||
56 | } |
||
57 |
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.