Skip to content

Instantly share code, notes, and snippets.

@tvlooy
Created January 21, 2014 19:34
Show Gist options
  • Select an option

  • Save tvlooy/8546709 to your computer and use it in GitHub Desktop.

Select an option

Save tvlooy/8546709 to your computer and use it in GitHub Desktop.
<?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