UpdateProductContainersUnitStockValueCommand
extends ContainerAwareCommand
in package
uses
LockableTrait
FinalYes
Class ProductStockValueCommand
Table of Contents
Properties
- $currencyService : CurrencyService|null
- $dbConnection : Connection
- $em : EntityManagerInterface
- $manufacturerStockValueService : ManufacturerStockValueService|null
- $productStockValueService : ProductStockValueService
Methods
- __construct() : mixed
- ProductStockValueCommand constructor.
- configure() : mixed
- Configure command
- execute() : mixed
- getLatestContainerUnitStockValueForProduct() : float|null
- Retrieves the most recent stock value per unit for a product's container
- updateProductContainerBuyingPrice() : bool
- Updates the container buying price for a product in the database
Properties
$currencyService
private
CurrencyService|null
$currencyService
$dbConnection
private
Connection
$dbConnection
$em
private
EntityManagerInterface
$em
$manufacturerStockValueService
private
ManufacturerStockValueService|null
$manufacturerStockValueService
$productStockValueService
private
ProductStockValueService
$productStockValueService
Methods
__construct()
ProductStockValueCommand constructor.
public
__construct([null $name = null ][, CurrencyService $currencyService = null ][, ManufacturerStockValueService $manufacturerStockValueService = null ]) : mixed
Parameters
- $name : null = null
- $currencyService : CurrencyService = null
- $manufacturerStockValueService : ManufacturerStockValueService = null
configure()
Configure command
protected
configure() : mixed
execute()
protected
execute(InputInterface $input, OutputInterface $output) : mixed
Parameters
- $input : InputInterface
- $output : OutputInterface
getLatestContainerUnitStockValueForProduct()
Retrieves the most recent stock value per unit for a product's container
private
getLatestContainerUnitStockValueForProduct(int $productId) : float|null
Parameters
- $productId : int
-
The ID of the product to get the container unit stock value for
Return values
float|null —Returns the latest container unit stock value if found, null otherwise
updateProductContainerBuyingPrice()
Updates the container buying price for a product in the database
private
updateProductContainerBuyingPrice(int $productId, float $unitValue) : bool
Parameters
- $productId : int
-
The ID of the product to update
- $unitValue : float
-
The new unit value to set
Return values
bool —Returns true if update was successful