ProductRowReservesSynchronizer
Synchronize the reserves of deal products with the basket items reserves.
Table of Contents
Methods
- __construct() : mixed
- sync() : array<string|int, mixed>
- Sync the product rows with the reserve quantity of the basket item.
- syncAndSave() : Result
- Sync and save the product rows with the reserve quantity of the basket item.
Methods
__construct()
public
__construct(int $dealId, Basket $basket, ReservationResult $reservationResult) : mixed
Parameters
- $dealId : int
- $basket : Basket
- $reservationResult : ReservationResult
sync()
Sync the product rows with the reserve quantity of the basket item.
public
sync() : array<string|int, mixed>
Return values
array<string|int, mixed> —in format [$isNeedSave, [rowId
=> reserveQuantity
]]
Variable isNeedSave
may be true, with empty map of product row reserves, when reserves is deleted.
syncAndSave()
Sync and save the product rows with the reserve quantity of the basket item.
public
syncAndSave() : Result
For more details see sync
method.