StockItem
extends StockItem
in package
Tags
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_mod_store_stock_items'
- #[TableAlias]
- 'stockItem'
Table of Contents
Properties
- $activated : bool
- $avgPurchasePrice : string|null
- $code : string
- $ean : string|null
- $externalId : int|null
- $externalModule : int|null
- $id : int|null
- $insertDatetime : DateTime
- $lastPurchasePrice : string|null
- $minQuantity : string|null
- $supplier : Supplier|null
- $supplierId : int|null
- $translations : Collection
- $unit : string
- $unitId : int|null
- $updateDatetime : DateTime|null
Methods
- __construct() : mixed
- addTranslation() : $this
- callInitMethods() : void
- Calls `init{TraitName}()` for every used trait that defines such a method.
- getActivated() : bool
- getAllTraits() : array<string, string>
- Returns all traits the class uses, including those used by parent classes and nested traits.
- getAvgPurchasePrice() : string|null
- getCode() : string
- getEan() : string|null
- getExternalId() : int|null
- getExternalModule() : int|null
- getId() : int|null
- getInsertDatetime() : DateTime
- getLastPurchasePrice() : string|null
- getMinQuantity() : string|null
- getSupplier() : Supplier|null
- getSupplierId() : int|null
- getTranslation() : TTranslation|null
- getTranslations() : Collection<int, TTranslation>
- getUnit() : string
- getUnitId() : int|null
- getUpdateDatetime() : DateTime|null
- isActivated() : bool
- isPersisted() : bool
- removeTranslation() : $this
- setActivated() : $this
- setAvgPurchasePrice() : $this
- setCode() : $this
- setEan() : $this
- setExternalId() : $this
- setExternalModule() : $this
- setId() : $this
- setInsertDatetime() : $this
- setLastPurchasePrice() : $this
- setMinQuantity() : $this
- setSupplier() : self
- setSupplierId() : $this
- setTranslations() : $this
- setUnit() : $this
- setUnitId() : TTranslation>
- setUpdateDatetime() : $this
- translationCollectionInit() : void
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$activated
protected
bool
$activated
= true
Attributes
- #[Column]
- $name: 'activated'
- $type: 'boolean'
$avgPurchasePrice
protected
string|null
$avgPurchasePrice
= null
Attributes
- #[Column]
- $name: 'avg_purchase_price'
- $type: 'decimal'
- $precision: 10
- $scale: 3
- $nullable: true
$code
protected
string
$code
= ''
Attributes
- #[Column]
- $name: 'code'
- $type: 'string'
- $length: 80
$ean
protected
string|null
$ean
= null
Attributes
- #[Column]
- $name: 'ean'
- $type: 'string'
- $length: 45
- $nullable: true
$externalId
protected
int|null
$externalId
= null
Attributes
- #[Column]
- $name: 'external_id'
- $type: 'integer'
- $nullable: true
- $options: ['unsigned' => true]
$externalModule
protected
int|null
$externalModule
= null
Attributes
- #[Column]
- $name: 'external_module'
- $type: 'integer'
- $nullable: true
- $options: ['unsigned' => true]
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'stock_item_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$insertDatetime
protected
DateTime
$insertDatetime
= new DateTime()
Attributes
- #[Column]
- $name: 'insert_datetime'
- $type: 'datetime'
$lastPurchasePrice
protected
string|null
$lastPurchasePrice
= null
Attributes
- #[Column]
- $name: 'last_purchase_price'
- $type: 'decimal'
- $precision: 10
- $scale: 3
- $nullable: true
$minQuantity
protected
string|null
$minQuantity
= null
Attributes
- #[Column]
- $name: 'min_quantity'
- $type: 'decimal'
- $precision: 10
- $scale: 3
- $nullable: true
$supplier
protected
Supplier|null
$supplier
= null
Attributes
- #[JoinColumn]
- $name: 'cms_mod_store_suppliers_supplier_id'
- $referencedColumnName: 'supplier_id'
- $onDelete: 'SET NULL'
- #[ManyToOne]
- $targetEntity: \App\UI\Api\Store\Models\Entities\Supplier::class
$supplierId
protected
int|null
$supplierId
= null
Attributes
- #[Column]
- $name: 'cms_mod_store_suppliers_supplier_id'
- $type: 'integer'
- $insertable: false
- $updatable: false
- $nullable: true
- $options: ['unsigned' => true]
$translations
protected
Collection
$translations
Attributes
- #[OneToMany]
- $targetEntity: \App\UI\Api\Store\Models\Entities\StockItemText::class
- $mappedBy: 'parent'
- $cascade: ['persist', 'remove']
- $orphanRemoval: true
- $fetch: 'LAZY'
$unit
protected
string
$unit
= 'ks'
Attributes
- #[Column]
- $name: 'unit'
- $type: 'string'
- $length: 20
$unitId
protected
int|null
$unitId
= null
Attributes
- #[Column]
- $name: 'cms_system_units_unit_id'
- $type: 'integer'
- $nullable: true
- $options: ['unsigned' => true]
$updateDatetime
protected
DateTime|null
$updateDatetime
= null
Attributes
- #[Column]
- $name: 'update_datetime'
- $type: 'datetime'
- $nullable: true
Methods
__construct()
public
__construct([int|null $id = null ][, string $code = '' ][, string|null $ean = null ][, string $unit = 'ks' ][, int|null $unitId = null ][, int|null $supplierId = null ][, int|null $externalModule = null ][, int|null $externalId = null ][, string|null $minQuantity = null ][, string|null $avgPurchasePrice = null ][, string|null $lastPurchasePrice = null ][, bool $activated = true ][, DateTime $insertDatetime = new DateTime() ][, DateTime|null $updateDatetime = null ][, Collection $translations = new ArrayCollection() ]) : mixed
Parameters
- $id : int|null = null
- $code : string = ''
- $ean : string|null = null
- $unit : string = 'ks'
- $unitId : int|null = null
- $supplierId : int|null = null
- $externalModule : int|null = null
- $externalId : int|null = null
- $minQuantity : string|null = null
- $avgPurchasePrice : string|null = null
- $lastPurchasePrice : string|null = null
- $activated : bool = true
- $insertDatetime : DateTime = new DateTime()
- $updateDatetime : DateTime|null = null
- $translations : Collection = new ArrayCollection()
addTranslation()
public
addTranslation(TTranslation $translation) : $this
Parameters
- $translation : TTranslation
Return values
$thiscallInitMethods()
Calls `init{TraitName}()` for every used trait that defines such a method.
public
callInitMethods() : void
getActivated()
public
getActivated() : bool
Return values
boolgetAllTraits()
Returns all traits the class uses, including those used by parent classes and nested traits.
public
getAllTraits() : array<string, string>
Return values
array<string, string>getAvgPurchasePrice()
public
getAvgPurchasePrice() : string|null
Return values
string|nullgetCode()
public
getCode() : string
Return values
stringgetEan()
public
getEan() : string|null
Return values
string|nullgetExternalId()
public
getExternalId() : int|null
Return values
int|nullgetExternalModule()
public
getExternalModule() : int|null
Return values
int|nullgetId()
public
getId() : int|null
Return values
int|nullgetInsertDatetime()
public
getInsertDatetime() : DateTime
Return values
DateTimegetLastPurchasePrice()
public
getLastPurchasePrice() : string|null
Return values
string|nullgetMinQuantity()
public
getMinQuantity() : string|null
Return values
string|nullgetSupplier()
public
getSupplier() : Supplier|null
Return values
Supplier|nullgetSupplierId()
public
getSupplierId() : int|null
Return values
int|nullgetTranslation()
public
getTranslation(int $langId) : TTranslation|null
Parameters
- $langId : int
Return values
TTranslation|nullgetTranslations()
public
getTranslations() : Collection<int, TTranslation>
Return values
Collection<int, TTranslation>getUnit()
public
getUnit() : string
Return values
stringgetUnitId()
public
getUnitId() : int|null
Return values
int|nullgetUpdateDatetime()
public
getUpdateDatetime() : DateTime|null
Return values
DateTime|nullisActivated()
public
isActivated() : bool
Return values
boolisPersisted()
public
isPersisted() : bool
Return values
boolremoveTranslation()
public
removeTranslation(TTranslation $translation) : $this
Parameters
- $translation : TTranslation
Return values
$thissetActivated()
public
setActivated(bool $activated) : $this
Parameters
- $activated : bool
Return values
$thissetAvgPurchasePrice()
public
setAvgPurchasePrice(string|null $avgPurchasePrice) : $this
Parameters
- $avgPurchasePrice : string|null
Return values
$thissetCode()
public
setCode(string $code) : $this
Parameters
- $code : string
Return values
$thissetEan()
public
setEan(string|null $ean) : $this
Parameters
- $ean : string|null
Return values
$thissetExternalId()
public
setExternalId(int|null $externalId) : $this
Parameters
- $externalId : int|null
Return values
$thissetExternalModule()
public
setExternalModule(int|null $externalModule) : $this
Parameters
- $externalModule : int|null
Return values
$thissetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetInsertDatetime()
public
setInsertDatetime(DateTime $insertDatetime) : $this
Parameters
- $insertDatetime : DateTime
Return values
$thissetLastPurchasePrice()
public
setLastPurchasePrice(string|null $lastPurchasePrice) : $this
Parameters
- $lastPurchasePrice : string|null
Return values
$thissetMinQuantity()
public
setMinQuantity(string|null $minQuantity) : $this
Parameters
- $minQuantity : string|null
Return values
$thissetSupplier()
public
setSupplier(Supplier|null $supplier) : self
Parameters
- $supplier : Supplier|null
Return values
selfsetSupplierId()
public
setSupplierId(int|null $supplierId) : $this
Parameters
- $supplierId : int|null
Return values
$thissetTranslations()
public
setTranslations(Collection<int, TTranslation>|array<int, TTranslation> $translations) : $this
Parameters
- $translations : Collection<int, TTranslation>|array<int, TTranslation>
Return values
$thissetUnit()
public
setUnit(string $unit) : $this
Parameters
- $unit : string
Return values
$thissetUnitId()
public
setUnitId(int|null $unitId) : TTranslation>
Parameters
- $unitId : int|null
Return values
TTranslation>setUpdateDatetime()
public
setUpdateDatetime(DateTime|null $updateDatetime) : $this
Parameters
- $updateDatetime : DateTime|null
Return values
$thistranslationCollectionInit()
public
translationCollectionInit() : void
getTraitsRecursive()
Walks the trait list recursively and collects nested traits too.
private
static getTraitsRecursive(array<string, string> $traits) : array<string, string>
Parameters
- $traits : array<string, string>