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) { foreach ($this->features as $index => $current) { if ($current === $feature) { unset($this->features[$index]); $current->removeProduct(); return true; } } return false; } }