StockMovementBatch
extends BaseEntity
in package
implements
IdentifiableInterface
uses
IdentifiableTrait
AbstractYes
Movement x batch pairing (precise `FIFO` `COGS`). Written by services via raw DBAL; the entity serves reads (movement `COGS` breakdown). Read-only FK columns kept as plain scalars — it does not belong to the draft object graph (no #[CollectionOf] on StockMovement).
Attributes
- #[MappedSuperclass]
- #[TableAlias]
- $alias: 'stockMovementBatch'
Table of Contents
Interfaces
- IdentifiableInterface
- Entity with a simple integer primary key. Most entities have one (often via {@see \App\Core\Traits\Shared\Models\Entities\IdentifiableTrait}); texts and links with a composite key do not, which is why `getId()` is not on {@see \App\Core\Base\BaseEntity}. Code that needs the id of a generic entity asks for this interface (parameter type, template bound, `instanceof`).
Properties
- $batchId : int|null
- $batchNumber : string|null
- $id : int|null
- $movementId : int|null
- $quantity : string
- $unitPriceBase : string|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.
- getBatchId() : int|null
- getBatchNumber() : string|null
- getId() : int|null
- getMovementId() : int|null
- getQuantity() : string
- getUnitPriceBase() : string|null
- isPersisted() : bool
- setBatchId() : $this
- setBatchNumber() : $this
- setId() : $this
- setMovementId() : $this
- setQuantity() : $this
- setUnitPriceBase() : $this
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$batchId
protected
int|null
$batchId
= null
Attributes
- #[Column]
- $name: 'cms_mod_store_stock_batches_stock_batch_id'
- $type: 'bigint'
- $nullable: true
- $options: ['unsigned' => true]
$batchNumber
protected
string|null
$batchNumber
= null
Attributes
- #[Column]
- $name: 'batch_number'
- $type: 'string'
- $length: 60
- $nullable: true
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'stock_movement_batch_id'
- $type: 'bigint'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$movementId
protected
int|null
$movementId
= null
Attributes
- #[Column]
- $name: 'cms_mod_store_stock_movements_stock_movement_id'
- $type: 'bigint'
- $options: ['unsigned' => true]
$quantity
protected
string
$quantity
= '0.000'
Attributes
- #[Column]
- $name: 'quantity'
- $type: 'decimal'
- $precision: 10
- $scale: 3
$unitPriceBase
protected
string|null
$unitPriceBase
= null
Attributes
- #[Column]
- $name: 'unit_price_base'
- $type: 'decimal'
- $precision: 10
- $scale: 3
- $nullable: true
Methods
__construct()
public
__construct([int|null $id = null ][, int|null $movementId = null ][, int|null $batchId = null ][, string $quantity = '0.000' ][, string|null $unitPriceBase = null ][, string|null $batchNumber = null ]) : mixed
Parameters
- $id : int|null = null
- $movementId : int|null = null
- $batchId : int|null = null
- $quantity : string = '0.000'
- $unitPriceBase : string|null = null
- $batchNumber : string|null = null
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>getBatchId()
public
getBatchId() : int|null
Return values
int|nullgetBatchNumber()
public
getBatchNumber() : string|null
Return values
string|nullgetId()
public
getId() : int|null
Return values
int|nullgetMovementId()
public
getMovementId() : int|null
Return values
int|nullgetQuantity()
public
getQuantity() : string
Return values
stringgetUnitPriceBase()
public
getUnitPriceBase() : string|null
Return values
string|nullisPersisted()
public
isPersisted() : bool
Return values
boolsetBatchId()
public
setBatchId(int|null $batchId) : $this
Parameters
- $batchId : int|null
Return values
$thissetBatchNumber()
public
setBatchNumber(string|null $batchNumber) : $this
Parameters
- $batchNumber : string|null
Return values
$thissetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetMovementId()
public
setMovementId(int|null $movementId) : $this
Parameters
- $movementId : int|null
Return values
$thissetQuantity()
public
setQuantity(string $quantity) : $this
Parameters
- $quantity : string
Return values
$thissetUnitPriceBase()
public
setUnitPriceBase(string|null $unitPriceBase) : $this
Parameters
- $unitPriceBase : string|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>