Product
in package
Attributes
- #[ApiResource]
- $operations: [new \ApiPlatform\Metadata\GetCollection(), new \ApiPlatform\Metadata\Patch(denormalizationContext: ['groups' => ['product:update']]), new \ApiPlatform\Metadata\Get()]
- $normalizationContext: ['groups' => ['product:read']]
- $denormalizationContext: ['groups' => ['product:write']]
- $filters: [\App\Filter\PointOfSaleParamFilter::class]
- #[Entity]
- $repositoryClass: \App\Repository\ProductRepository::class
- #[Index]
- $columns: ['status']
- $name: "idx_status"
- #[Index]
- $columns: ['name']
- $name: "idx_name"
- #[Index]
- $columns: ['archive_status']
- $name: "idx_archive_status"
- #[UniqueConstraint]
- $name: 'uniq_product_name_by_pos'
- $columns: ['name', 'point_of_sale_id', 'barcode']
- #[UniqueEntity]
- $fields: ['name', 'pointOfSaleId']
- $message: "Le nom du produit doit ĂȘtre unique par point de vente"
- #[UniqueEntity]
- $fields: ['barcode', 'pointOfSaleId']
- $message: "Le code barre doit ĂȘtre unique"
Table of Contents
Constants
Properties
- $currentAlertType : string|null
- $alert_threshold_sale : int|null
- $alert_threshold_warehouse : int|null
- $approval_certificate : string|null
- $archive_status : bool|null
- $barcode : string|null
- $bulk_price : float|null
- $carts : Collection
- $category : Category|null
- $certificate_origin : string|null
- $created_at : DateTimeImmutable|null
- $description : string|null
- $expiration_date : DateTimeInterface|null
- $historyPurchaseOrders : Collection
- $id : int|null
- $image : string|null
- $inventoryProducts : Collection
- $invoice_purchase : string|null
- $isRawMaterial : bool|null
- $manufacturing_date : DateTimeInterface|null
- $name : string|null
- $pointOfSaleId : int|null
- $productVariants : Collection
- $purchase_date : DateTimeInterface|null
- $purchase_price : float|null
- $purchaseOrders : Collection
- $quantity : int|null
- $retail_price : float|null
- $saleProductStocks : Collection
- $status : string|null
- $status_en_stock : bool|null
- $supplier : Supplier|null
- $unit_of_measurement : string|null
- $updated_at : DateTimeImmutable|null
- $warehouse_stock : int|null
Methods
- __construct() : mixed
- addCart() : static
- addHistoryPurchaseOrder() : static
- addInventoryProduct() : static
- addProductVariant() : static
- addPurchaseOrder() : static
- addSaleProductStock() : static
- getAlertThresholdSale() : int|null
- getAlertThresholdWarehouse() : int|null
- getApprovalCertificate() : string|null
- getBarcode() : string|null
- getBulkPrice() : float|null
- getCarts() : Collection<int, Cart>
- getCategory() : Category|null
- getCertificateOrigin() : string|null
- getCreatedAt() : DateTimeImmutable|null
- getDescription() : string|null
- getExpirationDate() : DateTimeInterface|null
- getHistoryPurchaseOrders() : Collection<int, HistoryPurchaseOrder>
- getId() : int|null
- getImage() : string|null
- getInventoryProducts() : Collection<int, InventoryProduct>
- getInvoicePurchase() : string|null
- getManufacturingDate() : DateTimeInterface|null
- getName() : string|null
- getPointOfSaleId() : int|null
- getProductVariants() : Collection<int, ProductVariant>
- getPurchaseDate() : DateTimeInterface|null
- getPurchaseOrders() : Collection<int, PurchaseOrder>
- getPurchasePrice() : float|null
- getQuantity() : int|null
- getRetailPrice() : float|null
- getSaleProductStocks() : Collection<int, SaleProductStock>
- getStatus() : string|null
- getSupplier() : Supplier|null
- getUnitOfMeasurement() : string|null
- getUpdatedAt() : DateTimeImmutable|null
- getWarehouseStock() : int|null
- isArchiveStatus() : bool|null
- isIsRawMaterial() : bool|null
- isStatusEnStock() : bool|null
- removeCart() : static
- removeHistoryPurchaseOrder() : static
- removeInventoryProduct() : static
- removeProductVariant() : static
- removePurchaseOrder() : static
- removeSaleProductStock() : static
- setAlertThresholdSale() : static
- setAlertThresholdWarehouse() : static
- setApprovalCertificate() : static
- setArchiveStatus() : static
- setBarcode() : static
- setBulkPrice() : static
- setCategory() : static
- setCertificateOrigin() : static
- setCreatedAt() : static
- setDescription() : static
- setExpirationDate() : static
- setImage() : static
- setInvoicePurchase() : static
- setIsRawMaterial() : static
- setManufacturingDate() : static
- setName() : static
- setPointOfSaleId() : static
- setPurchaseDate() : static
- setPurchasePrice() : static
- setQuantity() : static
- setRetailPrice() : static
- setStatus() : static
- setStatusEnStock() : static
- setSupplier() : static
- setUnitOfMeasurement() : static
- setUpdatedAt() : static
- setWarehouseStock() : static
- toArray() : array<string|int, mixed>
Constants
ACTIF
public
mixed
ACTIF
= "ACTIF"
AUCUN
public
mixed
AUCUN
= "AUCUN"
INACTIF
public
mixed
INACTIF
= "INACTIF"
Properties
$currentAlertType
public
string|null
$currentAlertType
= null
Property used temporarily for email alerts (not persisted)
$alert_threshold_sale
private
int|null
$alert_threshold_sale
= null
Attributes
- #[Column]
- $nullable: true
$alert_threshold_warehouse
private
int|null
$alert_threshold_warehouse
= null
Attributes
- #[Column]
- $nullable: true
$approval_certificate
private
string|null
$approval_certificate
= null
Attributes
- #[Column]
- $nullable: true
$archive_status
private
bool|null
$archive_status
= null
Attributes
- #[Column]
$barcode
private
string|null
$barcode
= null
Attributes
- #[Column]
- $length: 255
- $nullable: true
- #[Groups]
- ['product:read']
$bulk_price
private
float|null
$bulk_price
= null
Attributes
- #[Column]
- $nullable: true
- #[Groups]
- ['session:read']
$carts
private
Collection
$carts
Attributes
- #[OneToMany]
- $mappedBy: 'product'
- $targetEntity: \App\Entity\Cart::class
$category
private
Category|null
$category
= null
Attributes
- #[Groups]
- ['product:read', 'product:write']
- #[JoinColumn]
- $nullable: false
- #[ManyToOne]
- $inversedBy: 'products'
$certificate_origin
private
string|null
$certificate_origin
= null
Attributes
- #[Column]
- $nullable: true
$created_at
private
DateTimeImmutable|null
$created_at
= null
Attributes
- #[Column]
$description
private
string|null
$description
= null
Attributes
- #[Column]
- $type: \Doctrine\DBAL\Types\Types::TEXT
- $nullable: true
$expiration_date
private
DateTimeInterface|null
$expiration_date
= null
Attributes
- #[Column]
- $type: \Doctrine\DBAL\Types\Types::DATE_MUTABLE
- $nullable: true
$historyPurchaseOrders
private
Collection
$historyPurchaseOrders
Attributes
- #[OneToMany]
- $mappedBy: 'product'
- $targetEntity: \App\Entity\HistoryPurchaseOrder::class
$id
private
int|null
$id
= null
Attributes
- #[Column]
- #[GeneratedValue]
- #[Groups]
- ['product:read', 'session:read']
- #[Id]
$image
private
string|null
$image
= null
Attributes
- #[Column]
- $length: 255
- $nullable: true
- #[Groups]
- ['product:read']
$inventoryProducts
private
Collection
$inventoryProducts
Attributes
- #[OneToMany]
- $mappedBy: 'product'
- $targetEntity: \App\Entity\InventoryProduct::class
$invoice_purchase
private
string|null
$invoice_purchase
= null
Attributes
- #[Column]
- $nullable: true
$isRawMaterial
private
bool|null
$isRawMaterial
= null
Attributes
- #[Column]
$manufacturing_date
private
DateTimeInterface|null
$manufacturing_date
= null
Attributes
- #[Column]
- $type: \Doctrine\DBAL\Types\Types::DATE_MUTABLE
- $nullable: true
$name
private
string|null
$name
= null
Attributes
- #[Column]
- $length: 255
- #[Groups]
- ['product:read', 'session:read']
$pointOfSaleId
private
int|null
$pointOfSaleId
= null
Attributes
- #[Column]
$productVariants
private
Collection
$productVariants
Attributes
- #[OneToMany]
- $mappedBy: 'product'
- $targetEntity: \App\Entity\ProductVariant::class
- $cascade: ['persist']
- $orphanRemoval: true
$purchase_date
private
DateTimeInterface|null
$purchase_date
= null
Attributes
- #[Column]
- $type: \Doctrine\DBAL\Types\Types::DATETIME_MUTABLE
- $nullable: true
$purchase_price
private
float|null
$purchase_price
= null
Attributes
- #[Column]
- $nullable: true
- #[Groups]
- ['session:read']
$purchaseOrders
private
Collection
$purchaseOrders
Attributes
- #[OneToMany]
- $mappedBy: 'product'
- $targetEntity: \App\Entity\PurchaseOrder::class
$quantity
private
int|null
$quantity
= null
Attributes
- #[Column]
- #[Groups]
- ['product:read', 'product:update', 'session:read']
$retail_price
private
float|null
$retail_price
= null
Attributes
- #[Column]
- $nullable: true
- #[Groups]
- ['product:read', 'session:read']
$saleProductStocks
private
Collection
$saleProductStocks
Attributes
- #[OneToMany]
- $mappedBy: 'product'
- $targetEntity: \App\Entity\SaleProductStock::class
- $cascade: ['persist']
$status
private
string|null
$status
= null
Attributes
- #[Column]
- $length: 255
- $nullable: true
$status_en_stock
private
bool|null
$status_en_stock
= null
Attributes
- #[Column]
$supplier
private
Supplier|null
$supplier
= null
Attributes
- #[ManyToOne]
- $inversedBy: 'products'
$unit_of_measurement
private
string|null
$unit_of_measurement
= null
Attributes
- #[Column]
- $length: 255
- $nullable: true
$updated_at
private
DateTimeImmutable|null
$updated_at
= null
Attributes
- #[Column]
$warehouse_stock
private
int|null
$warehouse_stock
= null
Attributes
- #[Column]
- $nullable: true
Methods
__construct()
public
__construct() : mixed
addCart()
public
addCart(Cart $cart) : static
Parameters
- $cart : Cart
Return values
staticaddHistoryPurchaseOrder()
public
addHistoryPurchaseOrder(HistoryPurchaseOrder $historyPurchaseOrder) : static
Parameters
- $historyPurchaseOrder : HistoryPurchaseOrder
Return values
staticaddInventoryProduct()
public
addInventoryProduct(InventoryProduct $inventoryProduct) : static
Parameters
- $inventoryProduct : InventoryProduct
Return values
staticaddProductVariant()
public
addProductVariant(ProductVariant $productVariant) : static
Parameters
- $productVariant : ProductVariant
Return values
staticaddPurchaseOrder()
public
addPurchaseOrder(PurchaseOrder $purchaseOrder) : static
Parameters
- $purchaseOrder : PurchaseOrder
Return values
staticaddSaleProductStock()
public
addSaleProductStock(SaleProductStock $saleProductStock) : static
Parameters
- $saleProductStock : SaleProductStock
Return values
staticgetAlertThresholdSale()
public
getAlertThresholdSale() : int|null
Return values
int|nullgetAlertThresholdWarehouse()
public
getAlertThresholdWarehouse() : int|null
Return values
int|nullgetApprovalCertificate()
public
getApprovalCertificate() : string|null
Return values
string|nullgetBarcode()
public
getBarcode() : string|null
Return values
string|nullgetBulkPrice()
public
getBulkPrice() : float|null
Return values
float|nullgetCarts()
public
getCarts() : Collection<int, Cart>
Return values
Collection<int, Cart>getCategory()
public
getCategory() : Category|null
Return values
Category|nullgetCertificateOrigin()
public
getCertificateOrigin() : string|null
Return values
string|nullgetCreatedAt()
public
getCreatedAt() : DateTimeImmutable|null
Return values
DateTimeImmutable|nullgetDescription()
public
getDescription() : string|null
Return values
string|nullgetExpirationDate()
public
getExpirationDate() : DateTimeInterface|null
Return values
DateTimeInterface|nullgetHistoryPurchaseOrders()
public
getHistoryPurchaseOrders() : Collection<int, HistoryPurchaseOrder>
Return values
Collection<int, HistoryPurchaseOrder>getId()
public
getId() : int|null
Return values
int|nullgetImage()
public
getImage() : string|null
Return values
string|nullgetInventoryProducts()
public
getInventoryProducts() : Collection<int, InventoryProduct>
Return values
Collection<int, InventoryProduct>getInvoicePurchase()
public
getInvoicePurchase() : string|null
Return values
string|nullgetManufacturingDate()
public
getManufacturingDate() : DateTimeInterface|null
Return values
DateTimeInterface|nullgetName()
public
getName() : string|null
Return values
string|nullgetPointOfSaleId()
public
getPointOfSaleId() : int|null
Return values
int|nullgetProductVariants()
public
getProductVariants() : Collection<int, ProductVariant>
Return values
Collection<int, ProductVariant>getPurchaseDate()
public
getPurchaseDate() : DateTimeInterface|null
Return values
DateTimeInterface|nullgetPurchaseOrders()
public
getPurchaseOrders() : Collection<int, PurchaseOrder>
Return values
Collection<int, PurchaseOrder>getPurchasePrice()
public
getPurchasePrice() : float|null
Return values
float|nullgetQuantity()
public
getQuantity() : int|null
Return values
int|nullgetRetailPrice()
public
getRetailPrice() : float|null
Return values
float|nullgetSaleProductStocks()
public
getSaleProductStocks() : Collection<int, SaleProductStock>
Return values
Collection<int, SaleProductStock>getStatus()
public
getStatus() : string|null
Return values
string|nullgetSupplier()
public
getSupplier() : Supplier|null
Return values
Supplier|nullgetUnitOfMeasurement()
public
getUnitOfMeasurement() : string|null
Return values
string|nullgetUpdatedAt()
public
getUpdatedAt() : DateTimeImmutable|null
Return values
DateTimeImmutable|nullgetWarehouseStock()
public
getWarehouseStock() : int|null
Return values
int|nullisArchiveStatus()
public
isArchiveStatus() : bool|null
Return values
bool|nullisIsRawMaterial()
public
isIsRawMaterial() : bool|null
Return values
bool|nullisStatusEnStock()
public
isStatusEnStock() : bool|null
Return values
bool|nullremoveCart()
public
removeCart(Cart $cart) : static
Parameters
- $cart : Cart
Return values
staticremoveHistoryPurchaseOrder()
public
removeHistoryPurchaseOrder(HistoryPurchaseOrder $historyPurchaseOrder) : static
Parameters
- $historyPurchaseOrder : HistoryPurchaseOrder
Return values
staticremoveInventoryProduct()
public
removeInventoryProduct(InventoryProduct $inventoryProduct) : static
Parameters
- $inventoryProduct : InventoryProduct
Return values
staticremoveProductVariant()
public
removeProductVariant(ProductVariant $productVariant) : static
Parameters
- $productVariant : ProductVariant
Return values
staticremovePurchaseOrder()
public
removePurchaseOrder(PurchaseOrder $purchaseOrder) : static
Parameters
- $purchaseOrder : PurchaseOrder
Return values
staticremoveSaleProductStock()
public
removeSaleProductStock(SaleProductStock $saleProductStock) : static
Parameters
- $saleProductStock : SaleProductStock
Return values
staticsetAlertThresholdSale()
public
setAlertThresholdSale(int|null $alert_threshold_sale) : static
Parameters
- $alert_threshold_sale : int|null
Return values
staticsetAlertThresholdWarehouse()
public
setAlertThresholdWarehouse(int|null $alert_threshold_warehouse) : static
Parameters
- $alert_threshold_warehouse : int|null
Return values
staticsetApprovalCertificate()
public
setApprovalCertificate(string|null $approval_certificate) : static
Parameters
- $approval_certificate : string|null
Return values
staticsetArchiveStatus()
public
setArchiveStatus(bool $archive_status) : static
Parameters
- $archive_status : bool
Return values
staticsetBarcode()
public
setBarcode(string|null $barcode) : static
Parameters
- $barcode : string|null
Return values
staticsetBulkPrice()
public
setBulkPrice(float|null $bulk_price) : static
Parameters
- $bulk_price : float|null
Return values
staticsetCategory()
public
setCategory(Category|null $category) : static
Parameters
- $category : Category|null
Return values
staticsetCertificateOrigin()
public
setCertificateOrigin(string|null $certificate_origin) : static
Parameters
- $certificate_origin : string|null
Return values
staticsetCreatedAt()
public
setCreatedAt(DateTimeImmutable|null $created_at) : static
Parameters
- $created_at : DateTimeImmutable|null
Return values
staticsetDescription()
public
setDescription(string|null $description) : static
Parameters
- $description : string|null
Return values
staticsetExpirationDate()
public
setExpirationDate(DateTimeInterface|null $expiration_date) : static
Parameters
- $expiration_date : DateTimeInterface|null
Return values
staticsetImage()
public
setImage(string|null $image) : static
Parameters
- $image : string|null
Return values
staticsetInvoicePurchase()
public
setInvoicePurchase(string|null $invoice_purchase) : static
Parameters
- $invoice_purchase : string|null
Return values
staticsetIsRawMaterial()
public
setIsRawMaterial(bool $isRawMaterial) : static
Parameters
- $isRawMaterial : bool
Return values
staticsetManufacturingDate()
public
setManufacturingDate(DateTimeInterface|null $manufacturing_date) : static
Parameters
- $manufacturing_date : DateTimeInterface|null
Return values
staticsetName()
public
setName(string $name) : static
Parameters
- $name : string
Return values
staticsetPointOfSaleId()
public
setPointOfSaleId(int $pointOfSale) : static
Parameters
- $pointOfSale : int
Return values
staticsetPurchaseDate()
public
setPurchaseDate(DateTimeInterface|null $purchase_date) : static
Parameters
- $purchase_date : DateTimeInterface|null
Return values
staticsetPurchasePrice()
public
setPurchasePrice(float $purchase_price) : static
Parameters
- $purchase_price : float
Return values
staticsetQuantity()
public
setQuantity(int $quantity) : static
Parameters
- $quantity : int
Return values
staticsetRetailPrice()
public
setRetailPrice(float|null $retail_price) : static
Parameters
- $retail_price : float|null
Return values
staticsetStatus()
public
setStatus(string|null $status) : static
Parameters
- $status : string|null
Return values
staticsetStatusEnStock()
public
setStatusEnStock(bool $status_en_stock) : static
Parameters
- $status_en_stock : bool
Return values
staticsetSupplier()
public
setSupplier(Supplier|null $supplier) : static
Parameters
- $supplier : Supplier|null
Return values
staticsetUnitOfMeasurement()
public
setUnitOfMeasurement(string|null $unit_of_measurement) : static
Parameters
- $unit_of_measurement : string|null
Return values
staticsetUpdatedAt()
public
setUpdatedAt(DateTimeImmutable $updated_at) : static
Parameters
- $updated_at : DateTimeImmutable
Return values
staticsetWarehouseStock()
public
setWarehouseStock(int|null $warehouse_stock) : static
Parameters
- $warehouse_stock : int|null
Return values
statictoArray()
public
toArray() : array<string|int, mixed>