15 private static $instance;
20 private function __construct()
28 if (is_null(static::$instance))
33 return static::$instance;
45 $basketRow = $basketClass::getList([
46 'select' => [
'ID',
'ORDER_ID'],
56 return static::getInstance()->getByRow($basketRow);
63 public function getByIds(array $ids): array
70 $basketList = $basketClass::getList([
71 'select' => [
'ID',
'ORDER_ID'],
77 while ($basketRow = $basketList->fetch())
79 $basket = static::getInstance()->getByRow($basketRow);
95 private function getByRow(array $basketRow): ?
Sale\BasketItem
100 $order = $orderClassName::load($basketRow[
'ORDER_ID']);
106 $basket = $order->getBasket();
109 foreach ($basket as $basketItem)
111 if ($basketItem->getId() !== (
int)$basketRow[
'ID'])