StockMovement
extends StockMovement
in package
Movement — owned collection StockDocument.movements (cascade persist/remove).
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_mod_store_stock_movements'
- #[TableAlias]
- 'stockMovement'
Table of Contents
Properties
- $batchNumber : string|null
- $cogsUnitPrice : string|null
- $currency : Currency|null
- $currencyId : int|null
- $document : StockDocument|null
- $documentId : int|null
- $exchangeRate : string|null
- $expirationDate : DateTime|null
- $id : int|null
- $insertDatetime : DateTime
- $itemCode : string
- $itemName : string
- $note : string|null
- $quantity : string
- $quantityAfter : string|null
- $selectedBatchId : int|null
- $stockItem : StockItem|null
- $stockItemId : int|null
- $unitPrice : string|null
- $unitPriceBase : string|null
- $warehouse : Warehouse|null
- $warehouseId : int|null
Methods
- __construct() : mixed
- callInitMethods() : void
- Calls `init{TraitName}()` for every used trait that defines such a method.
- getAllTraits() : array<string, string>
- Returns all traits the class uses, including those used by parent classes and nested traits.
- getBatchNumber() : string|null
- getCogsUnitPrice() : string|null
- getCurrency() : Currency|null
- getCurrencyId() : int|null
- getDocument() : StockDocument|null
- getDocumentId() : int|null
- getExchangeRate() : string|null
- getExpirationDate() : DateTime|null
- getId() : int|null
- getInsertDatetime() : DateTime
- getItemCode() : string
- getItemName() : string
- getNote() : string|null
- getQuantity() : string
- getQuantityAfter() : string|null
- getSelectedBatchId() : int|null
- getStockItem() : StockItem|null
- getStockItemId() : int|null
- getUnitPrice() : string|null
- getUnitPriceBase() : string|null
- getWarehouse() : Warehouse|null
- getWarehouseId() : int|null
- isPersisted() : bool
- setBatchNumber() : $this
- setCogsUnitPrice() : $this
- setCurrency() : self
- setCurrencyId() : $this
- setDocument() : self
- setDocumentId() : $this
- setExchangeRate() : $this
- setExpirationDate() : $this
- setId() : $this
- setInsertDatetime() : $this
- setItemCode() : $this
- setItemName() : $this
- setNote() : $this
- setQuantity() : $this
- setQuantityAfter() : $this
- setSelectedBatchId() : $this
- setStockItem() : self
- setStockItemId() : $this
- setUnitPrice() : $this
- setUnitPriceBase() : $this
- setWarehouse() : self
- setWarehouseId() : $this
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$batchNumber
protected
string|null
$batchNumber
= null
Attributes
- #[Column]
- $name: 'batch_number'
- $type: 'string'
- $length: 60
- $nullable: true
$cogsUnitPrice
protected
string|null
$cogsUnitPrice
= null
Attributes
- #[Column]
- $name: 'cogs_unit_price'
- $type: 'decimal'
- $precision: 10
- $scale: 3
- $nullable: true
$currency
protected
Currency|null
$currency
= null
Attributes
- #[JoinColumn]
- $name: 'cms_system_currencies_currency_id'
- $referencedColumnName: 'currency_id'
- $onDelete: 'SET NULL'
- #[ManyToOne]
- $targetEntity: \App\UI\Api\System\Models\Entities\Currency::class
$currencyId
protected
int|null
$currencyId
= null
Attributes
- #[Column]
- $name: 'cms_system_currencies_currency_id'
- $type: 'integer'
- $insertable: false
- $updatable: false
- $nullable: true
- $options: ['unsigned' => true]
$document
protected
StockDocument|null
$document
= null
Attributes
- #[JoinColumn]
- $name: 'cms_mod_store_stock_documents_stock_document_id'
- $referencedColumnName: 'stock_document_id'
- $onDelete: 'RESTRICT'
- #[ManyToOne]
- $targetEntity: \App\UI\Api\Store\Models\Entities\StockDocument::class
- $inversedBy: 'movements'
$documentId
protected
int|null
$documentId
= null
Attributes
- #[Column]
- $name: 'cms_mod_store_stock_documents_stock_document_id'
- $type: 'integer'
- $insertable: false
- $updatable: false
- $nullable: true
- $options: ['unsigned' => true]
$exchangeRate
protected
string|null
$exchangeRate
= null
Attributes
- #[Column]
- $name: 'exchange_rate'
- $type: 'decimal'
- $precision: 15
- $scale: 6
- $nullable: true
$expirationDate
protected
DateTime|null
$expirationDate
= null
Attributes
- #[Column]
- $name: 'expiration_date'
- $type: 'date'
- $nullable: true
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'stock_movement_id'
- $type: 'bigint'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$insertDatetime
protected
DateTime
$insertDatetime
= new DateTime()
Attributes
- #[Column]
- $name: 'insert_datetime'
- $type: 'datetime'
$itemCode
protected
string
$itemCode
= ''
Attributes
- #[Column]
- $name: 'item_code'
- $type: 'string'
- $length: 80
$itemName
protected
string
$itemName
= ''
Attributes
- #[Column]
- $name: 'item_name'
- $type: 'string'
- $length: 255
$note
protected
string|null
$note
= null
Attributes
- #[Column]
- $name: 'note'
- $type: 'string'
- $length: 255
- $nullable: true
$quantity
protected
string
$quantity
= '0.000'
Attributes
- #[Column]
- $name: 'quantity'
- $type: 'decimal'
- $precision: 10
- $scale: 3
$quantityAfter
protected
string|null
$quantityAfter
= null
Attributes
- #[Column]
- $name: 'quantity_after'
- $type: 'decimal'
- $precision: 10
- $scale: 3
- $nullable: true
$selectedBatchId
protected
int|null
$selectedBatchId
= null
Attributes
- #[Column]
- $name: 'selected_batch_id'
- $type: 'bigint'
- $nullable: true
- $options: ['unsigned' => true]
$stockItem
protected
StockItem|null
$stockItem
= null
Attributes
- #[JoinColumn]
- $name: 'cms_mod_store_stock_items_stock_item_id'
- $referencedColumnName: 'stock_item_id'
- $onDelete: 'SET NULL'
- #[ManyToOne]
- $targetEntity: \App\UI\Api\Store\Models\Entities\StockItem::class
$stockItemId
protected
int|null
$stockItemId
= null
Attributes
- #[Column]
- $name: 'cms_mod_store_stock_items_stock_item_id'
- $type: 'integer'
- $insertable: false
- $updatable: false
- $nullable: true
- $options: ['unsigned' => true]
$unitPrice
protected
string|null
$unitPrice
= null
Attributes
- #[Column]
- $name: 'unit_price'
- $type: 'decimal'
- $precision: 10
- $scale: 3
- $nullable: true
$unitPriceBase
protected
string|null
$unitPriceBase
= null
Attributes
- #[Column]
- $name: 'unit_price_base'
- $type: 'decimal'
- $precision: 10
- $scale: 3
- $nullable: true
$warehouse
protected
Warehouse|null
$warehouse
= null
Attributes
- #[JoinColumn]
- $name: 'cms_mod_store_warehouses_warehouse_id'
- $referencedColumnName: 'warehouse_id'
- $onDelete: 'SET NULL'
- #[ManyToOne]
- $targetEntity: \App\UI\Api\Store\Models\Entities\Warehouse::class
$warehouseId
protected
int|null
$warehouseId
= null
Attributes
- #[Column]
- $name: 'cms_mod_store_warehouses_warehouse_id'
- $type: 'integer'
- $insertable: false
- $updatable: false
- $nullable: true
- $options: ['unsigned' => true]
Methods
__construct()
public
__construct([int|null $id = null ][, int|null $documentId = null ][, int|null $stockItemId = null ][, int|null $warehouseId = null ][, string $quantity = '0.000' ][, string|null $quantityAfter = null ][, string $itemCode = '' ][, string $itemName = '' ][, string|null $batchNumber = null ][, DateTime|null $expirationDate = null ][, int|null $selectedBatchId = null ][, string|null $unitPrice = null ][, int|null $currencyId = null ][, string|null $exchangeRate = null ][, string|null $unitPriceBase = null ][, string|null $cogsUnitPrice = null ][, string|null $note = null ][, DateTime $insertDatetime = new DateTime() ]) : mixed
Parameters
- $id : int|null = null
- $documentId : int|null = null
- $stockItemId : int|null = null
- $warehouseId : int|null = null
- $quantity : string = '0.000'
- $quantityAfter : string|null = null
- $itemCode : string = ''
- $itemName : string = ''
- $batchNumber : string|null = null
- $expirationDate : DateTime|null = null
- $selectedBatchId : int|null = null
- $unitPrice : string|null = null
- $currencyId : int|null = null
- $exchangeRate : string|null = null
- $unitPriceBase : string|null = null
- $cogsUnitPrice : string|null = null
- $note : string|null = null
- $insertDatetime : DateTime = new DateTime()
callInitMethods()
Calls `init{TraitName}()` for every used trait that defines such a method.
public
callInitMethods() : void
getAllTraits()
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>getBatchNumber()
public
getBatchNumber() : string|null
Return values
string|nullgetCogsUnitPrice()
public
getCogsUnitPrice() : string|null
Return values
string|nullgetCurrency()
public
getCurrency() : Currency|null
Return values
Currency|nullgetCurrencyId()
public
getCurrencyId() : int|null
Return values
int|nullgetDocument()
public
getDocument() : StockDocument|null
Return values
StockDocument|nullgetDocumentId()
public
getDocumentId() : int|null
Return values
int|nullgetExchangeRate()
public
getExchangeRate() : string|null
Return values
string|nullgetExpirationDate()
public
getExpirationDate() : DateTime|null
Return values
DateTime|nullgetId()
public
getId() : int|null
Return values
int|nullgetInsertDatetime()
public
getInsertDatetime() : DateTime
Return values
DateTimegetItemCode()
public
getItemCode() : string
Return values
stringgetItemName()
public
getItemName() : string
Return values
stringgetNote()
public
getNote() : string|null
Return values
string|nullgetQuantity()
public
getQuantity() : string
Return values
stringgetQuantityAfter()
public
getQuantityAfter() : string|null
Return values
string|nullgetSelectedBatchId()
public
getSelectedBatchId() : int|null
Return values
int|nullgetStockItem()
public
getStockItem() : StockItem|null
Return values
StockItem|nullgetStockItemId()
public
getStockItemId() : int|null
Return values
int|nullgetUnitPrice()
public
getUnitPrice() : string|null
Return values
string|nullgetUnitPriceBase()
public
getUnitPriceBase() : string|null
Return values
string|nullgetWarehouse()
public
getWarehouse() : Warehouse|null
Return values
Warehouse|nullgetWarehouseId()
public
getWarehouseId() : int|null
Return values
int|nullisPersisted()
public
isPersisted() : bool
Return values
boolsetBatchNumber()
public
setBatchNumber(string|null $batchNumber) : $this
Parameters
- $batchNumber : string|null
Return values
$thissetCogsUnitPrice()
public
setCogsUnitPrice(string|null $cogsUnitPrice) : $this
Parameters
- $cogsUnitPrice : string|null
Return values
$thissetCurrency()
public
setCurrency(Currency|null $currency) : self
Parameters
- $currency : Currency|null
Return values
selfsetCurrencyId()
public
setCurrencyId(int|null $currencyId) : $this
Parameters
- $currencyId : int|null
Return values
$thissetDocument()
public
setDocument(StockDocument|null $document) : self
Parameters
- $document : StockDocument|null
Return values
selfsetDocumentId()
public
setDocumentId(int|null $documentId) : $this
Parameters
- $documentId : int|null
Return values
$thissetExchangeRate()
public
setExchangeRate(string|null $exchangeRate) : $this
Parameters
- $exchangeRate : string|null
Return values
$thissetExpirationDate()
public
setExpirationDate(DateTime|null $expirationDate) : $this
Parameters
- $expirationDate : DateTime|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
$thissetItemCode()
public
setItemCode(string $itemCode) : $this
Parameters
- $itemCode : string
Return values
$thissetItemName()
public
setItemName(string $itemName) : $this
Parameters
- $itemName : string
Return values
$thissetNote()
public
setNote(string|null $note) : $this
Parameters
- $note : string|null
Return values
$thissetQuantity()
public
setQuantity(string $quantity) : $this
Parameters
- $quantity : string
Return values
$thissetQuantityAfter()
public
setQuantityAfter(string|null $quantityAfter) : $this
Parameters
- $quantityAfter : string|null
Return values
$thissetSelectedBatchId()
public
setSelectedBatchId(int|null $selectedBatchId) : $this
Parameters
- $selectedBatchId : int|null
Return values
$thissetStockItem()
public
setStockItem(StockItem|null $stockItem) : self
Parameters
- $stockItem : StockItem|null
Return values
selfsetStockItemId()
public
setStockItemId(int|null $stockItemId) : $this
Parameters
- $stockItemId : int|null
Return values
$thissetUnitPrice()
public
setUnitPrice(string|null $unitPrice) : $this
Parameters
- $unitPrice : string|null
Return values
$thissetUnitPriceBase()
public
setUnitPriceBase(string|null $unitPriceBase) : $this
Parameters
- $unitPriceBase : string|null
Return values
$thissetWarehouse()
public
setWarehouse(Warehouse|null $warehouse) : self
Parameters
- $warehouse : Warehouse|null
Return values
selfsetWarehouseId()
public
setWarehouseId(int|null $warehouseId) : $this
Parameters
- $warehouseId : int|null
Return values
$thisgetTraitsRecursive()
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>