3 namespace Doctrine\Tests\Models\StockExchange;
5 use Doctrine\Common\Collections\ArrayCollection;
9 * @Table(name="exchange_markets")
14 * @Id @Column(type="integer") @GeneratedValue
20 * @Column(type="string")
26 * @OneToMany(targetEntity="Stock", mappedBy="market", indexBy="symbol")
31 public function __construct($name)
34 $this->stocks = new ArrayCollection();
37 public function getId()
42 public function getName()
47 public function addStock(Stock $stock)
49 $this->stocks[$stock->getSymbol()] = $stock;
52 public function getStock($symbol)
54 return $this->stocks[$symbol];