Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / orm / tests / Doctrine / Tests / Models / DDC117 / DDC117Editor.php
1 <?php
2
3 namespace Doctrine\Tests\Models\DDC117;
4
5 /**
6  * @Entity
7  */
8 class DDC117Editor
9 {
10     /**
11      * @Id @Column(type="integer") @GeneratedValue
12      */
13     public $id;
14
15     /**
16      * @Column(type="string")
17      */
18     public $name;
19
20     /**
21      * @ManyToMany(targetEntity="DDC117Translation", inversedBy="reviewedByEditors")
22      * @JoinTable(
23      *   inverseJoinColumns={
24      *     @JoinColumn(name="article_id", referencedColumnName="article_id"),
25      *     @JoinColumn(name="language", referencedColumnName="language")
26      *   },
27      *   joinColumns={
28      *     @JoinColumn(name="editor_id", referencedColumnName="id")
29      *   }
30      * )
31      */
32     public $reviewingTranslations;
33
34     /**
35      * @ManyToOne(targetEntity="DDC117Translation", inversedBy="lastTranslatedBy")
36      * @JoinColumns({
37      *   @JoinColumn(name="lt_article_id", referencedColumnName="article_id"),
38      *   @JoinColumn(name="lt_language", referencedColumnName="language")
39      * })
40      */
41     public $lastTranslation;
42
43     public function __construct($name = "")
44     {
45         $this->name = $name;
46         $this->reviewingTranslations = new \Doctrine\Common\Collections\ArrayCollection();
47     }
48
49     public function addLastTranslation(DDC117Translation $t)
50     {
51         $this->lastTranslation = $t;
52         $t->lastTranslatedBy[] = $this;
53     }
54 }