| 1 | <?php |
||
| 7 | class Owner |
||
| 8 | { |
||
| 9 | private $name; |
||
| 10 | |||
| 11 | /** |
||
| 12 | * @Serializer\Type("Happyr\SerializerBundle\Tests\Fixtures\Composition\Car") |
||
| 13 | */ |
||
| 14 | private $car; |
||
| 15 | |||
| 16 | private $birthday; |
||
| 17 | |||
| 18 | public function __construct($withValues = false) |
||
| 19 | { |
||
| 20 | if ($withValues) { |
||
| 21 | $this->name = 'Foobar'; |
||
| 22 | $this->car = new Car(true); |
||
| 23 | $this->birthday = new \DateTime('-21years'); |
||
| 24 | } |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @return Car |
||
| 29 | */ |
||
| 30 | public function getCar() |
||
| 31 | { |
||
| 32 | return $this->car; |
||
| 33 | } |
||
| 34 | } |
||
| 35 |