-
#[ApiResource]
-
$operations: [new \ApiPlatform\Metadata\GetCollection(), new \ApiPlatform\Metadata\Get()]
-
$normalizationContext: ['groups' => ['category:read']]
-
$filters: [\App\Filter\PointOfSaleParamFilter::class]
-
#[Entity]
-
$repositoryClass: \App\Repository\CategoryRepository::class
-
#[UniqueConstraint]
-
$name: 'uniq_category_name_pos'
-
$columns: ['name', 'point_of_sale_id']
-
#[UniqueEntity]
-
$fields: ['name', 'pointOfSaleId']
-
$message: "Le nom de la catĂ©gorie doit ĂȘtre unique par point de vente"
Table of Contents
Constants
-
CATEGORY
: mixed = "category"
-
SUB_CATEGORY
: mixed = "sub-category"
Properties
-
$archiveStatus
: bool|null
-
$category
: self|null
-
$created_at
: DateTimeImmutable|null
-
$id
: int|null
-
$name
: string|null
-
$pointOfSaleId
: int|null
-
$products
: Collection
-
$productStocks
: Collection
-
$subCategory
: Collection
-
$type
: string|null
-
$updated_at
: DateTimeImmutable|null
Methods
-
__construct()
: mixed
-
addProduct()
: static
-
addProductStock()
: static
-
addSubCategory()
: static
-
getCategory()
: self|null
-
getCreatedAt()
: DateTimeImmutable|null
-
getId()
: int|null
-
getName()
: string|null
-
getPointOfSale()
: int|null
-
getProducts()
: Collection<int, Product>
-
getProductStocks()
: Collection<int, ProductStock>
-
getSubCategory()
: Collection<int, self>
-
getType()
: string|null
-
getUpdatedAt()
: DateTimeImmutable|null
-
isArchiveStatus()
: bool|null
-
removeProduct()
: static
-
removeProductStock()
: static
-
removeSubCategory()
: static
-
setArchiveStatus()
: static
-
setCategory()
: static
-
setCreatedAt()
: static
-
setName()
: static
-
setPointOfSale()
: static
-
setType()
: static
-
setUpdatedAt()
: static
CATEGORY
public
mixed
CATEGORY
= "category"
SUB_CATEGORY
public
mixed
SUB_CATEGORY
= "sub-category"
$archiveStatus
private
bool|null
$archiveStatus
= null
-
#[Column]
-
$nullable: true
$category
private
self|null
$category
= null
-
#[ManyToOne]
-
$targetEntity: self::class
-
$inversedBy: 'subCategory'
$created_at
private
DateTimeImmutable|null
$created_at
= null
$id
private
int|null
$id
= null
-
#[Column]
-
#[GeneratedValue]
-
#[Groups]
-
'category:read'
-
#[Id]
$name
private
string|null
$name
= null
-
#[Column]
-
$length: 255
-
#[Groups]
-
'category:read'
$pointOfSaleId
private
int|null
$pointOfSaleId
= null
$products
private
Collection
$products
-
#[OneToMany]
-
$mappedBy: 'category'
-
$targetEntity: \App\Entity\Product::class
$productStocks
private
Collection
$productStocks
-
#[OneToMany]
-
$mappedBy: 'category'
-
$targetEntity: \App\Entity\ProductStock::class
$subCategory
private
Collection
$subCategory
-
#[OneToMany]
-
$mappedBy: 'category'
-
$targetEntity: self::class
$type
private
string|null
$type
= null
-
#[Column]
-
$length: 255
-
$nullable: true
$updated_at
private
DateTimeImmutable|null
$updated_at
= null
__construct()
public
__construct() : mixed
addProduct()
public
addProduct(Product $productStock) : static
Parameters
-
$productStock
: Product
-
addProductStock()
public
addProductStock(ProductStock $productStock) : static
Parameters
-
$productStock
: ProductStock
-
addSubCategory()
public
addSubCategory(self $subCategory) : static
Parameters
-
$subCategory
: self
-
getCategory()
public
getCategory() : self|null
getCreatedAt()
public
getCreatedAt() : DateTimeImmutable|null
Return values
DateTimeImmutable|null
getId()
public
getId() : int|null
getName()
public
getName() : string|null
Return values
string|null
getPointOfSale()
public
getPointOfSale() : int|null
getProducts()
public
getProducts() : Collection<int, Product>
Return values
Collection<int, Product>
getProductStocks()
public
getProductStocks() : Collection<int, ProductStock>
getSubCategory()
public
getSubCategory() : Collection<int, self>
Return values
Collection<int, self>
getType()
public
getType() : string|null
Return values
string|null
getUpdatedAt()
public
getUpdatedAt() : DateTimeImmutable|null
Return values
DateTimeImmutable|null
isArchiveStatus()
public
isArchiveStatus() : bool|null
removeProduct()
public
removeProduct(Product $product) : static
Parameters
-
$product
: Product
-
removeProductStock()
public
removeProductStock(ProductStock $productStock) : static
Parameters
-
$productStock
: ProductStock
-
removeSubCategory()
public
removeSubCategory(self $subCategory) : static
Parameters
-
$subCategory
: self
-
setArchiveStatus()
public
setArchiveStatus(bool|null $archiveStatus) : static
Parameters
-
$archiveStatus
: bool|null
-
setCategory()
public
setCategory(self|null $category) : static
Parameters
-
$category
: self|null
-
setCreatedAt()
public
setCreatedAt(DateTimeImmutable $created_at) : static
Parameters
-
$created_at
: DateTimeImmutable
-
setName()
public
setName(string $name) : static
Parameters
-
$name
: string
-
setPointOfSale()
public
setPointOfSale(int $pointOfSale) : static
Parameters
-
$pointOfSale
: int
-
setType()
public
setType(string|null $type) : static
Parameters
-
$type
: string|null
-
setUpdatedAt()
public
setUpdatedAt(DateTimeImmutable $updated_at) : static
Parameters
-
$updated_at
: DateTimeImmutable
-