Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / orm / tools / sandbox / Entities / User.php
1 <?php
2
3 namespace Entities;
4
5 /** @Entity @Table(name="users") */
6 class User
7 {
8     /**
9      * @Id @Column(type="integer")
10      * @GeneratedValue(strategy="AUTO")
11      */
12     private $id;
13     /** @Column(type="string", length=50) */
14     private $name;
15     /**
16      * @OneToOne(targetEntity="Address", inversedBy="user")
17      * @JoinColumn(name="address_id", referencedColumnName="id")
18      */
19     private $address;
20
21     public function getId()
22     {
23         return $this->id;
24     }
25
26     public function getName()
27     {
28         return $this->name;
29     }
30
31     public function setName($name)
32     {
33         $this->name = $name;
34     }
35
36     public function getAddress()
37     {
38         return $this->address;
39     }
40
41     public function setAddress(Address $address)
42     {
43         if ($this->address !== $address) {
44             $this->address = $address;
45             $address->setUser($this);
46         }
47     }
48 }