15 private static $instance;
20 private function __construct()
28 if (is_null(static::$instance))
33 return static::$instance;
45 $shipmentRow = $shipmentClass::getList([
46 'select' => [
'ID',
'ORDER_ID'],
56 return static::getInstance()->getByRow($shipmentRow);
63 public function getByIds(array $ids): array
70 $shipmentList = $shipmentClass::getList([
71 'select' => [
'ID',
'ORDER_ID'],
77 while ($shipmentRow = $shipmentList->fetch())
79 $shipment = static::getInstance()->getByRow($shipmentRow);
80 if (is_null($shipment))
85 $result[] = $shipment;
95 private function getByRow(array $shipmenRow): ?
Sale\Shipment
100 $order = $orderClassName::load($shipmenRow[
'ORDER_ID']);
106 $shipmentCollection = $order->getShipmentCollection();
109 foreach ($shipmentCollection as $shipment)
111 if ($shipment->getId() !== (
int)$shipmenRow[
'ID'])