Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / orm / tests / Doctrine / Tests / ORM / Tools / Export / annotation / Doctrine.Tests.ORM.Tools.Export.User.php
1 <?php
2
3 namespace Doctrine\Tests\ORM\Tools\Export;
4
5 /**
6  * @Entity
7  * @HasLifecycleCallbacks
8  * @Table(name="cms_users")
9  */
10 class User
11 {
12     /** @Id @Column(type="integer") @generatedValue(strategy="AUTO") */
13     public $id;
14
15     /**
16      * @Column(length=50, nullable=true, unique=true)
17      */
18     public $name;
19
20     /**
21      * @Column(name="user_email", columnDefinition="CHAR(32) NOT NULL")
22      */
23     public $email;
24
25     /**
26      * @OneToOne(targetEntity="Doctrine\Tests\ORM\Tools\Export\Address", inversedBy="user", cascade={"persist"}, orphanRemoval=true)
27      * @JoinColumn(name="address_id", onDelete="CASCADE")
28      */
29     public $address;
30
31     /**
32      * @ManyToOne(targetEntity="Doctrine\Tests\ORM\Tools\Export\Group")
33      */
34     public $mainGroup;
35
36     /**
37      *
38      * @OneToMany(targetEntity="Doctrine\Tests\ORM\Tools\Export\Phonenumber", mappedBy="user", cascade={"persist", "merge"}, orphanRemoval=true)
39      * @OrderBy({"number"="ASC"})
40      */
41     public $phonenumbers;
42
43     /**
44      * @ManyToMany(targetEntity="Doctrine\Tests\ORM\Tools\Export\Group", cascade={"all"})
45      * @JoinTable(name="cms_users_groups",
46      *    joinColumns={@JoinColumn(name="user_id", referencedColumnName="id", nullable=false, unique=false)},
47      *    inverseJoinColumns={@JoinColumn(name="group_id", referencedColumnName="id", columnDefinition="INT NULL")}
48      * )
49      */
50     public $groups;
51
52
53     /**
54      * @PrePersist
55      */
56     public function doStuffOnPrePersist()
57     {
58     }
59
60     /**
61      * @PrePersist
62      */
63     public function doOtherStuffOnPrePersistToo()
64     {
65     }
66
67     /**
68      * @PostPersist
69      */
70     public function doStuffOnPostPersist()
71     {
72     }
73 }