Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / orm / tests / Doctrine / Tests / Models / StockExchange / Stock.php
1 <?php
2
3 namespace Doctrine\Tests\Models\StockExchange;
4
5 use Doctrine\Common\Collections\ArrayCollection;
6
7 /**
8  * @Entity
9  * @Table(name="exchange_stocks")
10  */
11 class Stock
12 {
13     /**
14      * @Id @GeneratedValue @Column(type="integer")
15      * @var int
16      */
17     private $id;
18
19     /**
20      * For real this column would have to be unique=true. But I want to test behavior of non-unique overrides.
21      *
22      * @Column(type="string")
23      */
24     private $symbol;
25
26     /**
27      * @Column(type="decimal")
28      */
29     private $price;
30
31     /**
32      * @ManyToOne(targetEntity="Market", inversedBy="stocks")
33      * @var Market
34      */
35     private $market;
36
37     public function __construct($symbol, $initialOfferingPrice, Market $market)
38     {
39         $this->symbol = $symbol;
40         $this->price = $initialOfferingPrice;
41         $this->market = $market;
42         $market->addStock($this);
43     }
44
45     public function getSymbol()
46     {
47         return $this->symbol;
48     }
49 }