ReservationService
Service for work with reservation of product rows.
Table of Contents
Methods
- __construct() : mixed
- fillBasketReserves() : array<string|int, mixed>
- Filling basket item fields `RESERVE_QUANTITY` and `RESERVE_ID` for product rows.
- fillCrmReserves() : array<string|int, array<string|int, mixed>>
- Fill crm reserves.
- getDefaultDateReserveEnd() : Date
- Default date reserve end, if it is not filled.
- getInstance() : self
- Service instance.
- getRestrictedProductTypes() : array<string|int, mixed>
- isReserveEqualProductQuantity() : bool
- Check as reserve strategy is `ReserveQuantityEqualProductQuantityStrategy`.
- isRestrictedType() : bool
- mappingReservations() : void
- Synchronize deal product rows reserves with order basket items by result of reservation.
- removeReservesProductsByPayment() : Result
- Remove payment reservations.
- reservationProductRow() : Result
- Reservation one concrete product row.
- reservationProducts() : Result
- Reservation all products of entity.
- reservationProductsByDealProductRows() : Result
- reservationProductsByEntityProductRows() : Result
- Reservation products of entity.
- reservationProductsByPayment() : Result
- Reservation products by payment.
Methods
__construct()
public
__construct() : mixed
fillBasketReserves()
Filling basket item fields `RESERVE_QUANTITY` and `RESERVE_ID` for product rows.
public
fillBasketReserves(array<string|int, mixed> $productRows) : array<string|int, mixed>
Parameters
- $productRows : array<string|int, mixed>
Return values
array<string|int, mixed>fillCrmReserves()
Fill crm reserves.
public
fillCrmReserves(array<string|int, array<string|int, mixed>> $productRows) : array<string|int, array<string|int, mixed>>
Parameters
- $productRows : array<string|int, array<string|int, mixed>>
Return values
array<string|int, array<string|int, mixed>>getDefaultDateReserveEnd()
Default date reserve end, if it is not filled.
public
getDefaultDateReserveEnd() : Date
Return values
DategetInstance()
Service instance.
public
static getInstance() : self
Return values
selfgetRestrictedProductTypes()
public
getRestrictedProductTypes() : array<string|int, mixed>
Return values
array<string|int, mixed>isReserveEqualProductQuantity()
Check as reserve strategy is `ReserveQuantityEqualProductQuantityStrategy`.
public
isReserveEqualProductQuantity() : bool
Return values
boolisRestrictedType()
public
isRestrictedType(int $type) : bool
Parameters
- $type : int
Return values
boolmappingReservations()
Synchronize deal product rows reserves with order basket items by result of reservation.
public
mappingReservations(int $ownerTypeId, int $ownerId, Order $order) : void
Parameters
- $ownerTypeId : int
- $ownerId : int
- $order : Order
removeReservesProductsByPayment()
Remove payment reservations.
public
removeReservesProductsByPayment(Payment $payment) : Result
Called when payment canceled. Working ONLY if current reservation strategy is 'ReservePaidProductsStrategy'.
Parameters
- $payment : Payment
Return values
ResultreservationProductRow()
Reservation one concrete product row.
public
reservationProductRow(int $productRowId, float $quantity[, int|null $storeId = null ][, Date|null $dateReserveEnd = null ]) : Result
Parameters
- $productRowId : int
- $quantity : float
- $storeId : int|null = null
- $dateReserveEnd : Date|null = null
Return values
ResultreservationProducts()
Reservation all products of entity.
public
reservationProducts(int $ownerTypeId, int $ownerId) : Result
Parameters
- $ownerTypeId : int
- $ownerId : int
Return values
ResultreservationProductsByDealProductRows()
public
reservationProductsByDealProductRows(int $dealId, array<string|int, mixed> $productRows) : Result
use ::reservationProductsByEntityProductRows
method.
Reservation products of deal.
Parameters
- $dealId : int
- $productRows : array<string|int, mixed>
Return values
ResultreservationProductsByEntityProductRows()
Reservation products of entity.
public
reservationProductsByEntityProductRows(int $entityTypeId, int $entityId, array<string|int, mixed> $productRows) : Result
Parameters
- $entityTypeId : int
- $entityId : int
- $productRows : array<string|int, mixed>
Return values
ResultreservationProductsByPayment()
Reservation products by payment.
public
reservationProductsByPayment(Payment $payment) : Result
Parameters
- $payment : Payment