2013-03-31 03:47:45 +04:00
|
|
|
<?php
|
|
|
|
|
2013-04-07 18:26:05 +04:00
|
|
|
namespace Doctrine\Tests\Models\DDC2372\Traits;
|
2013-03-31 03:47:45 +04:00
|
|
|
|
2013-04-07 18:26:05 +04:00
|
|
|
trait DDC2372AddressTrait
|
2013-03-31 03:47:45 +04:00
|
|
|
{
|
|
|
|
/**
|
2013-04-07 18:26:05 +04:00
|
|
|
* @OneToOne(targetEntity="Doctrine\Tests\Models\DDC2372\DDC2372Address", inversedBy="user")
|
2013-03-31 03:47:45 +04:00
|
|
|
* @JoinColumn(name="address_id", referencedColumnName="id")
|
|
|
|
*/
|
|
|
|
private $address;
|
|
|
|
|
|
|
|
public function getAddress()
|
|
|
|
{
|
|
|
|
return $this->address;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setAddress(Address $address)
|
|
|
|
{
|
|
|
|
if ($this->address !== $address) {
|
|
|
|
$this->address = $address;
|
|
|
|
$address->setUser($this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|