1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
basketreservationservice.php
См. документацию.
1<?php
2
3namespace Bitrix\Sale\Reservation;
4
5use Bitrix\Main\DI\ServiceLocator;
6use Bitrix\Main\Result;
7use Bitrix\Sale\Reservation\Internals\BasketReservationTable;
8
13{
17 protected $historyService;
18
22 public function __construct(
24 )
25 {
26 $this->historyService = $historyService;
27 }
28
34 public static function getInstance(): self
35 {
36 return ServiceLocator::getInstance()->get('sale.basketReservation');
37 }
38
45 public function add(array $fields): Result
46 {
48
49 if ($result->isSuccess())
50 {
51 $historyResult = $this->historyService->addByReservation($result->getId());
52 foreach ($historyResult->getErrors() as $err)
53 {
54 $result->addError($err);
55 }
56 }
57
58 return $result;
59 }
60
68 public function update(int $id, array $fields): Result
69 {
71
72 if ($result->isSuccess())
73 {
74 $historyResult = $this->historyService->updateByReservation($id);
75 foreach ($historyResult->getErrors() as $err)
76 {
77 $result->addError($err);
78 }
79 }
80
81 return $result;
82 }
83
90 public function delete(int $id): Result
91 {
93
94 if ($result->isSuccess())
95 {
96 $historyResult = $this->historyService->deleteByReservation($id);
97 foreach ($historyResult->getErrors() as $err)
98 {
99 $result->addError($err);
100 }
101 }
102
103 return $result;
104 }
105
115 {
116 return $this->historyService->getAvailableCountForOrder($orderId);
117 }
118
128 public function getAvailableCountForBasketItem(int $basketId, int $storeId): float
129 {
130 return $this->historyService->getAvailableCountForBasketItem($basketId, $storeId);
131 }
132
142 public function getAvailableCountForBasketItems(array $basketItemFilter): array
143 {
144 return $this->historyService->getAvailableCountForBasketItems($basketItemFilter);
145 }
146}
static delete($primary)
Определения datamanager.php:1644
static add(array $data)
Определения datamanager.php:877
static update($primary, array $data)
Определения datamanager.php:1256
getAvailableCountForBasketItem(int $basketId, int $storeId)
Определения basketreservationservice.php:128
__construct(BasketReservationHistoryService $historyService)
Определения basketreservationservice.php:22
getAvailableCountForBasketItems(array $basketItemFilter)
Определения basketreservationservice.php:142
$orderId
Определения payment.php:5
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
$fields
Определения yandex_run.php:501