Beispiel #1
0
 /**
  * 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;
 }
Beispiel #2
0
 /**
  * {@inheritdoc}
  */
 public function hasShipments()
 {
     return !$this->shipments->isEmpty();
 }