15 private static $instance;
20 private function __construct()
28 if (is_null(self::$instance))
30 self::$instance =
new self();
33 return self::$instance;
42 $paymentList = $this->getList([
43 'select' => [
'ID',
'ORDER_ID'],
49 return $paymentList[0] ??
null;
58 return $this->getList([
59 'select' => [
'ID',
'ORDER_ID'],
70 public function getList(array $parameters): array
77 $paymentList = $paymentClass::getList($parameters);
78 while ($paymentRow = $paymentList->fetch())
80 $payment = $this->getByRow($paymentRow);
81 if (is_null($payment))
96 private function getByRow(array $paymentRow): ?
Sale\Payment
101 $order = $orderClassName::load($paymentRow[
'ORDER_ID']);
107 $paymentId = (int)$paymentRow[
'ID'];
111 $payment = $order->getPaymentCollection()->getItemById($paymentRow[
'ID']);