CoolCMS API

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
#[ExternalReadonly]

$currency

protected Currency|null $currency = null
Attributes
#[EntityOf]
\App\UI\Admin\System\Models\Entities\Currency::class
#[JoinColumn]
$name: 'cms_system_currencies_currency_id'
$referencedColumnName: 'currency_id'
$onDelete: 'SET NULL'
#[ManyToOne]
$targetEntity: \App\UI\Admin\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
#[EntityOf]
\App\UI\Admin\Store\Models\Entities\StockDocument::class
#[JoinColumn]
$name: 'cms_mod_store_stock_documents_stock_document_id'
$referencedColumnName: 'stock_document_id'
$onDelete: 'RESTRICT'
#[ManyToOne]
$targetEntity: \App\UI\Admin\Store\Models\Entities\StockDocument::class
$inversedBy: 'movements'
#[ParentRef]

$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
#[ExternalReadonly]

$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'
#[ExternalReadonly]

$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
#[ExternalReadonly]

$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
#[EntityOf]
\App\UI\Admin\Store\Models\Entities\StockItem::class
#[JoinColumn]
$name: 'cms_mod_store_stock_items_stock_item_id'
$referencedColumnName: 'stock_item_id'
$onDelete: 'SET NULL'
#[ManyToOne]
$targetEntity: \App\UI\Admin\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
#[ExternalReadonly]

$warehouse

protected Warehouse|null $warehouse = null
Attributes
#[EntityOf]
\App\UI\Admin\Store\Models\Entities\Warehouse::class
#[JoinColumn]
$name: 'cms_mod_store_warehouses_warehouse_id'
$referencedColumnName: 'warehouse_id'
$onDelete: 'SET NULL'
#[ManyToOne]
$targetEntity: \App\UI\Admin\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|null

getCogsUnitPrice()

public getCogsUnitPrice() : string|null
Return values
string|null

getCurrencyId()

public getCurrencyId() : int|null
Return values
int|null

getDocumentId()

public getDocumentId() : int|null
Return values
int|null

getExchangeRate()

public getExchangeRate() : string|null
Return values
string|null

getExpirationDate()

public getExpirationDate() : DateTime|null
Return values
DateTime|null

getInsertDatetime()

public getInsertDatetime() : DateTime
Return values
DateTime

getItemCode()

public getItemCode() : string
Return values
string

getItemName()

public getItemName() : string
Return values
string

getNote()

public getNote() : string|null
Return values
string|null

getQuantity()

public getQuantity() : string
Return values
string

getQuantityAfter()

public getQuantityAfter() : string|null
Return values
string|null

getSelectedBatchId()

public getSelectedBatchId() : int|null
Return values
int|null

getStockItemId()

public getStockItemId() : int|null
Return values
int|null

getUnitPrice()

public getUnitPrice() : string|null
Return values
string|null

getUnitPriceBase()

public getUnitPriceBase() : string|null
Return values
string|null

getWarehouseId()

public getWarehouseId() : int|null
Return values
int|null

setBatchNumber()

public setBatchNumber(string|null $batchNumber) : $this
Parameters
$batchNumber : string|null
Return values
$this

setCogsUnitPrice()

public setCogsUnitPrice(string|null $cogsUnitPrice) : $this
Parameters
$cogsUnitPrice : string|null
Return values
$this

setCurrencyId()

public setCurrencyId(int|null $currencyId) : $this
Parameters
$currencyId : int|null
Return values
$this

setDocumentId()

public setDocumentId(int|null $documentId) : $this
Parameters
$documentId : int|null
Return values
$this

setExchangeRate()

public setExchangeRate(string|null $exchangeRate) : $this
Parameters
$exchangeRate : string|null
Return values
$this

setExpirationDate()

public setExpirationDate(DateTime|null $expirationDate) : $this
Parameters
$expirationDate : DateTime|null
Return values
$this

setId()

public setId(int|null $id) : $this
Parameters
$id : int|null
Return values
$this

setInsertDatetime()

public setInsertDatetime(DateTime $insertDatetime) : $this
Parameters
$insertDatetime : DateTime
Return values
$this

setItemCode()

public setItemCode(string $itemCode) : $this
Parameters
$itemCode : string
Return values
$this

setItemName()

public setItemName(string $itemName) : $this
Parameters
$itemName : string
Return values
$this

setNote()

public setNote(string|null $note) : $this
Parameters
$note : string|null
Return values
$this

setQuantity()

public setQuantity(string $quantity) : $this
Parameters
$quantity : string
Return values
$this

setQuantityAfter()

public setQuantityAfter(string|null $quantityAfter) : $this
Parameters
$quantityAfter : string|null
Return values
$this

setSelectedBatchId()

public setSelectedBatchId(int|null $selectedBatchId) : $this
Parameters
$selectedBatchId : int|null
Return values
$this

setStockItemId()

public setStockItemId(int|null $stockItemId) : $this
Parameters
$stockItemId : int|null
Return values
$this

setUnitPrice()

public setUnitPrice(string|null $unitPrice) : $this
Parameters
$unitPrice : string|null
Return values
$this

setUnitPriceBase()

public setUnitPriceBase(string|null $unitPriceBase) : $this
Parameters
$unitPriceBase : string|null
Return values
$this

setWarehouseId()

public setWarehouseId(int|null $warehouseId) : $this
Parameters
$warehouseId : int|null
Return values
$this

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>
Return values
array<string, string>
On this page

Search results