1
0
mirror of synced 2024-12-15 23:56:02 +03:00
doctrine2/tests/Doctrine/Tests/Models/DDC2372/Traits/DDC2372AddressTrait.php

25 lines
554 B
PHP
Raw Normal View History

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);
}
}
}