/** * Add Shipment to cart * * @param Shipment * @return Cart */ public function setShipment(Shipment $shipment) { $key = Shipment::getKey($shipment->getId()); $this->_shipments[$key] = $shipment; return $this; }
/** * Add a specified Shipment to this Discount * * @param Shipment * @return Discount */ public function setShipment(Shipment $shipment) { $key = Shipment::getKey($shipment->getId()); if (!in_array($key, $this->getShipments())) { $this->_shipments[] = $key; } return $this; }