features = new \Doctrine\Common\Collections\Collection; } public function getId() { return $this->id; } public function getName() { return $this->name; } public function setName($name) { $this->name = $name; } public function getShipping() { return $this->shipping; } public function setShipping(ECommerceShipping $shipping) { $this->shipping = $shipping; } public function removeShipping() { $this->shipping = null; } public function getFeatures() { return $this->features; } public function addFeature(ECommerceFeature $feature) { $this->features[] = $feature; $feature->setProduct($this); } /** does not set the owning side */ public function brokenAddFeature(ECommerceFeature $feature) { $this->features[] = $feature; } public function removeFeature(ECommerceFeature $feature) { if ($this->features->contains($feature)) { $removed = $this->features->removeElement($feature); if ($removed) { $feature->removeProduct(); return true; } } return false; } }