AvailabilityLogService
in package
implements
AvailabilityLogServiceInterface
Table of Contents
Interfaces
- AvailabilityLogServiceInterface
- Interface AvailabilityServiceInterface
Properties
- $categoryService : ProductApi|object
- $container : ContainerInterface
- $entityManager : EntityManagerInterface
- $logService : LogServiceInterface
- $productApi : ProductApi|object
- $productService : ProductService
- $mailerService : MailerService|object
Methods
- __construct() : mixed
- QueueService constructor.
- afterSaleProductChangedProduct() : mixed
- afterSaleProductCreated() : mixed
- afterSaleProductQtyUpdate() : mixed
- afterSaleProductUpdatedFromSale() : mixed
- checkAndChangeProductAvailability() : mixed
- Check and change product availability
- getRepo() : AvailabilityLogRepository
- logAvailabilityChange() : AvailabilityLog
- Logging availability
- processSaleProduct() : mixed
- Checking product quantity and if the product has a quantity less than or equals to 2 we check if we have a container arrival if so we set the product availability to the next container arrival date and the minimum quantity to dispatch this change is set dynamically by category
- save() : AvailabilityLog
- Save The Entity
- sendStockAlert() : bool
- Send stock alert if product qty is above the threshold
Properties
$categoryService
protected
ProductApi|object
$categoryService
$container
protected
ContainerInterface
$container
$entityManager
protected
EntityManagerInterface
$entityManager
$logService
protected
LogServiceInterface
$logService
$productApi
protected
ProductApi|object
$productApi
$productService
protected
ProductService
$productService
$mailerService
private
MailerService|object
$mailerService
Methods
__construct()
QueueService constructor.
public
__construct(ContainerInterface $container, EntityManagerInterface $entityManager, LogServiceInterface $logService) : mixed
Parameters
- $container : ContainerInterface
- $entityManager : EntityManagerInterface
- $logService : LogServiceInterface
afterSaleProductChangedProduct()
public
afterSaleProductChangedProduct(SaleProductSwitchEvent $event) : mixed
Parameters
- $event : SaleProductSwitchEvent
Tags
afterSaleProductCreated()
public
afterSaleProductCreated(AfterSaleProductCreatedFromSaleEvent $event) : mixed
Parameters
- $event : AfterSaleProductCreatedFromSaleEvent
Tags
afterSaleProductQtyUpdate()
public
afterSaleProductQtyUpdate(SaleProductQtyChangedEvent $event) : mixed
Parameters
- $event : SaleProductQtyChangedEvent
Tags
afterSaleProductUpdatedFromSale()
public
afterSaleProductUpdatedFromSale(AfterSaleProductUpdatedFromSaleEvent $event) : mixed
Parameters
- $event : AfterSaleProductUpdatedFromSaleEvent
Tags
checkAndChangeProductAvailability()
Check and change product availability
public
checkAndChangeProductAvailability(Product $product, SaleProduct $saleProduct) : mixed
Parameters
- $product : Product
- $saleProduct : SaleProduct
Tags
getRepo()
public
getRepo() : AvailabilityLogRepository
Return values
AvailabilityLogRepositorylogAvailabilityChange()
Logging availability
public
logAvailabilityChange(Product $product, mixed $oldAvailability, mixed $availability[, string $message = 'Mise à jour automatique de la date dispo' ][, null $user = null ]) : AvailabilityLog
Parameters
- $product : Product
- $oldAvailability : mixed
- $availability : mixed
- $message : string = 'Mise à jour automatique de la date dispo'
- $user : null = null
Return values
AvailabilityLogprocessSaleProduct()
Checking product quantity and if the product has a quantity less than or equals to 2 we check if we have a container arrival if so we set the product availability to the next container arrival date and the minimum quantity to dispatch this change is set dynamically by category
public
processSaleProduct(mixed $saleProduct) : mixed
Parameters
- $saleProduct : mixed
Tags
save()
Save The Entity
public
save(AvailabilityLog $availabilityLog) : AvailabilityLog
Parameters
- $availabilityLog : AvailabilityLog
Return values
AvailabilityLogsendStockAlert()
Send stock alert if product qty is above the threshold
private
sendStockAlert(mixed $product, mixed $thresholdQty, mixed $newProductAvailability) : bool
Parameters
- $product : mixed
- $thresholdQty : mixed
- $newProductAvailability : mixed