1
0
mirror of synced 2024-12-15 07:36:03 +03:00
doctrine2/tests/Doctrine/Tests/Models/Quote/Address.php
2012-06-18 14:42:59 -03:00

54 lines
850 B
PHP

<?php
namespace Doctrine\Tests\Models\Quote;
/**
* @Entity
* @Table(name="`quote-address`")
*/
class Address
{
/**
* @Id
* @GeneratedValue
* @Column(type="integer", name="`address-id`")
*/
public $id;
/**
* @Column(name="`address-zip`")
*/
public $zip;
/**
* @OneToOne(targetEntity="User", inversedBy="address")
* @JoinColumn(name="`user-id`", referencedColumnName="`user-id`")
*/
public $user;
public function setUser(User $user) {
if ($this->user !== $user) {
$this->user = $user;
$user->setAddress($this);
}
}
public function getId()
{
return $this->id;
}
public function getZip()
{
return $this->zip;
}
public function getUser()
{
return $this->user;
}
}