Created
January 21, 2014 19:34
-
-
Save tvlooy/8546709 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** @ORM */ | |
| class Person | |
| { | |
| /** @ORM */ | |
| private $adres; | |
| /** @ORM */ | |
| private $bus; | |
| /** @ORM */ | |
| private $stad; | |
| /** @ORM */ | |
| private $land; | |
| public function setAddress(Address $address) | |
| { | |
| $this->adres = $address->getAdres(); | |
| $this->bus = $address->getBus(); | |
| $this->stad = $address->getStad(); | |
| $this->land = $address->getLand(); | |
| } | |
| public function getAddress() | |
| { | |
| return new Address( | |
| $this->adres, | |
| $this->bus, | |
| $this->stad, | |
| $this->land | |
| ); | |
| } | |
| // enzovoort ... | |
| } | |
| class Address | |
| { | |
| private $adres; | |
| private $bus; | |
| private $stad; | |
| private $land; | |
| public function __construct($adres, $bus, $stad, $land) | |
| { | |
| $this->adres = $adres; | |
| $this->bus = $bus; | |
| $this->stad = $stad; | |
| $this->land = $land; | |
| } | |
| public function getAdres() | |
| { | |
| return $this->adres; | |
| } | |
| public function getBus() | |
| { | |
| return $this->bus; | |
| } | |
| public function getStad() | |
| { | |
| return $this->stad; | |
| } | |
| public function getLand() | |
| { | |
| return $this->land; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment