Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / orm / tests / Doctrine / Tests / Models / DDC117 / DDC117Reference.php
1 <?php
2
3 namespace Doctrine\Tests\Models\DDC117;
4
5 /**
6  * @Entity
7  */
8 class DDC117Reference
9 {
10     /**
11      * @Id
12      * @ManyToOne(targetEntity="DDC117Article", inversedBy="references")
13      * @JoinColumn(name="source_id", referencedColumnName="article_id")
14      */
15     private $source;
16
17     /**
18      * @Id
19      * @ManyToOne(targetEntity="DDC117Article")
20      * @JoinColumn(name="target_id", referencedColumnName="article_id")
21      */
22     private $target;
23
24     /**
25      * @column(type="string")
26      */
27     private $description;
28
29     /**
30      * @column(type="datetime")
31      */
32     private $created;
33
34     public function __construct($source, $target, $description)
35     {
36         $source->addReference($this);
37         $target->addReference($this);
38
39         $this->source = $source;
40         $this->target = $target;
41         $this->description = $description;
42         $this->created = new \DateTime("now");
43     }
44
45     public function source()
46     {
47         return $this->source;
48     }
49
50     public function target()
51     {
52         return $this->target;
53     }
54
55     public function setDescription($desc)
56     {
57         $this->description = $desc;
58     }
59
60     public function getDescription()
61     {
62         return $this->description;
63     }
64 }