Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / orm / tests / Doctrine / Tests / Models / ECommerce / ECommerceFeature.php
1 <?php
2
3 namespace Doctrine\Tests\Models\ECommerce;
4
5 /**
6  * Describes a product feature.
7  *
8  * @author Giorgio Sironi
9  * @Entity
10  * @Table(name="ecommerce_features")
11  */
12 class ECommerceFeature
13 {
14     /**
15      * @Column(type="integer")
16      * @Id
17      * @GeneratedValue
18      */
19     private $id;
20
21     /**
22      * @Column(length=50)
23      */
24     private $description;
25
26     /**
27      * @ManyToOne(targetEntity="ECommerceProduct", inversedBy="features")
28      * @JoinColumn(name="product_id", referencedColumnName="id")
29      */
30     private $product;
31
32     public function getId() {
33         return $this->id;
34     }
35
36     public function getDescription() {
37         return $this->description;
38     }
39
40     public function setDescription($description) {
41         $this->description = $description;
42     }
43
44     public function setProduct(ECommerceProduct $product) {
45         $this->product = $product;
46     }
47
48     public function removeProduct() {
49         if ($this->product !== null) {
50             $product = $this->product;
51             $this->product = null;
52             $product->removeFeature($this);
53         }
54     }
55
56     public function getProduct() {
57         return $this->product;
58     }
59 }