/** * Gets the last updated shipment of the order * * @return false|ShipmentInterface */ public function getLastShipment() { if ($this->shipments->isEmpty()) { return false; } $last = $this->shipments->first(); foreach ($this->shipments as $shipment) { if ($shipment->getUpdatedAt() > $last->getUpdatedAt()) { $last = $shipment; } } return $last; }
/** * {@inheritdoc} */ public function hasShipments() { return !$this->shipments->isEmpty(); }