ReservePaidProductsStrategy extends ManualStrategy
Strategy automatic reservation of product rows when they are paid.
If the product is already reserved for an equal or greater quantity, then nothing happens. If the product is already reserved for a smaller quantity, the reserve is updated to the paid quantity. If the product has not been reserved yet, a new reserve is created for the paid quantity.
Table of Contents
Properties
- $defaultDateReserveEnd : Date|null
- $defaultStoreId : int
Methods
- __construct() : mixed
- getDeductedProductRows() : array<string|int, mixed>
- The quantity of product rows deducted.
- removeReservesPaymentProducts() : ReservationResult
- Removing reserves for payment items.
- reservation() : ReservationResult
- Reservation all products of entity.
- reservationProductRow() : ReservationResult
- Reservation one concrete product row.
Properties
$defaultDateReserveEnd
public
Date|null
$defaultDateReserveEnd
$defaultStoreId
public
int
$defaultStoreId
Methods
__construct()
public
__construct() : mixed
getDeductedProductRows()
The quantity of product rows deducted.
public
getDeductedProductRows(array<string|int, mixed> $rowsIds) : array<string|int, mixed>
Parameters
- $rowsIds : array<string|int, mixed>
Return values
array<string|int, mixed> —in format [rowId => deductedQuantity]
removeReservesPaymentProducts()
Removing reserves for payment items.
public
removeReservesPaymentProducts(int $ownerTypeId, int $ownerId, Payment $payment) : ReservationResult
Used when canceling a payment.
Parameters
- $ownerTypeId : int
- $ownerId : int
- $payment : Payment
Return values
ReservationResultreservation()
Reservation all products of entity.
public
reservation(int $ownerTypeId, int $ownerId) : ReservationResult
Parameters
- $ownerTypeId : int
- $ownerId : int
Tags
Return values
ReservationResultreservationProductRow()
Reservation one concrete product row.
public
reservationProductRow(int $productRowId, float $quantity, int $storeId, Date|null $dateReserveEnd) : ReservationResult
Parameters
- $productRowId : int
- $quantity : float
- $storeId : int
- $dateReserveEnd : Date|null