Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / orm / tests / Doctrine / Tests / Models / Quote / Address.php
1 <?php
2
3 namespace Doctrine\Tests\Models\Quote;
4
5 /**
6  * @Entity
7  * @Table(name="`quote-address`")
8  */
9 class Address
10 {
11
12     /**
13      * @Id
14      * @GeneratedValue
15      * @Column(type="integer", name="`address-id`")
16      */
17     public $id;
18
19     /**
20      * @Column(name="`address-zip`")
21      */
22     public $zip;
23
24     /**
25      * @OneToOne(targetEntity="User", inversedBy="address")
26      * @JoinColumn(name="`user-id`", referencedColumnName="`user-id`")
27      */
28     public $user;
29
30
31     public function setUser(User $user) {
32         if ($this->user !== $user) {
33             $this->user = $user;
34             $user->setAddress($this);
35         }
36     }
37
38
39     public function getId()
40     {
41         return $this->id;
42     }
43
44     public function getZip()
45     {
46         return $this->zip;
47     }
48
49     public function getUser()
50     {
51         return $this->user;
52     }
53
54 }