1
0
mirror of synced 2024-12-17 00:18:42 +03:00
doctrine2/tests/Doctrine/Tests/Models/DDC2372/DDC2372Address.php

45 lines
838 B
PHP
Raw Normal View History

2013-04-07 18:26:05 +04:00
<?php
namespace Doctrine\Tests\Models\DDC2372;
/** @Entity @Table(name="addresses") */
class DDC2372Address
{
/**
* @Id @Column(type="integer")
* @GeneratedValue(strategy="AUTO")
*/
private $id;
/** @Column(type="string", length=255) */
private $street;
/** @OneToOne(targetEntity="User", mappedBy="address") */
private $user;
public function getId()
{
return $this->id;
}
public function getStreet()
{
return $this->street;
}
public function setStreet($street)
{
$this->street = $street;
}
public function getUser()
{
return $this->user;
}
public function setUser(User $user)
{
if ($this->user !== $user) {
$this->user = $user;
$user->setAddress($this);
}
}
}