StockReservation
extends BaseEntity
in package
implements
IdentifiableInterface
uses
IdentifiableTrait
AbstractYes
Reservation ledger — rows are never deleted, status changes keep the audit trail and idempotence per source ref. Written by the reservation service.
Attributes
- #[MappedSuperclass]
- #[TableAlias]
- $alias: 'stockReservation'
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
- $expiresDatetime : DateTime|null
- $id : int|null
- $insertDatetime : DateTime
- $note : string|null
- $quantity : string
- $sourceId : int
- $sourceModule : int
- $sourceType : string
- $status : int
- $stockItemId : int|null
- $updateDatetime : DateTime|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.
- getExpiresDatetime() : DateTime|null
- getId() : int|null
- getInsertDatetime() : DateTime
- getNote() : string|null
- getQuantity() : string
- getSourceId() : int
- getSourceModule() : int
- getSourceType() : string
- getStatus() : int
- getStockItemId() : int|null
- getUpdateDatetime() : DateTime|null
- getWarehouseId() : int|null
- isPersisted() : bool
- setExpiresDatetime() : $this
- setId() : $this
- setInsertDatetime() : $this
- setNote() : $this
- setQuantity() : $this
- setSourceId() : $this
- setSourceModule() : $this
- setSourceType() : $this
- setStatus() : $this
- setStockItemId() : $this
- setUpdateDatetime() : $this
- setWarehouseId() : $this
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$expiresDatetime
protected
DateTime|null
$expiresDatetime
= null
Attributes
- #[Column]
- $name: 'expires_datetime'
- $type: 'datetime'
- $nullable: true
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'stock_reservation_id'
- $type: 'bigint'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$insertDatetime
protected
DateTime
$insertDatetime
= new DateTime()
Attributes
- #[Column]
- $name: 'insert_datetime'
- $type: 'datetime'
$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
$sourceId
protected
int
$sourceId
= 0
Attributes
- #[Column]
- $name: 'source_id'
- $type: 'integer'
- $options: ['unsigned' => true]
$sourceModule
protected
int
$sourceModule
= 0
Attributes
- #[Column]
- $name: 'source_module'
- $type: 'integer'
- $options: ['unsigned' => true]
$sourceType
protected
string
$sourceType
= ''
Attributes
- #[Column]
- $name: 'source_type'
- $type: 'string'
- $length: 30
$status
protected
int
$status
= StockReservationStatus::ACTIVE
Attributes
- #[Column]
- $name: 'status'
- $type: 'integer'
- $options: ['unsigned' => true]
$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]
$updateDatetime
protected
DateTime|null
$updateDatetime
= null
Attributes
- #[Column]
- $name: 'update_datetime'
- $type: 'datetime'
- $nullable: true
$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 $stockItemId = null ][, int|null $warehouseId = null ][, string $quantity = '0.000' ][, int $status = StockReservationStatus::ACTIVE ][, int $sourceModule = 0 ][, string $sourceType = '' ][, int $sourceId = 0 ][, DateTime|null $expiresDatetime = null ][, string|null $note = null ][, DateTime $insertDatetime = new DateTime() ][, DateTime|null $updateDatetime = null ]) : mixed
Parameters
- $id : int|null = null
- $stockItemId : int|null = null
- $warehouseId : int|null = null
- $quantity : string = '0.000'
- $status : int = StockReservationStatus::ACTIVE
- $sourceModule : int = 0
- $sourceType : string = ''
- $sourceId : int = 0
- $expiresDatetime : DateTime|null = null
- $note : string|null = null
- $insertDatetime : DateTime = new DateTime()
- $updateDatetime : DateTime|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>getExpiresDatetime()
public
getExpiresDatetime() : DateTime|null
Return values
DateTime|nullgetId()
public
getId() : int|null
Return values
int|nullgetInsertDatetime()
public
getInsertDatetime() : DateTime
Return values
DateTimegetNote()
public
getNote() : string|null
Return values
string|nullgetQuantity()
public
getQuantity() : string
Return values
stringgetSourceId()
public
getSourceId() : int
Return values
intgetSourceModule()
public
getSourceModule() : int
Return values
intgetSourceType()
public
getSourceType() : string
Return values
stringgetStatus()
public
getStatus() : int
Return values
intgetStockItemId()
public
getStockItemId() : int|null
Return values
int|nullgetUpdateDatetime()
public
getUpdateDatetime() : DateTime|null
Return values
DateTime|nullgetWarehouseId()
public
getWarehouseId() : int|null
Return values
int|nullisPersisted()
public
isPersisted() : bool
Return values
boolsetExpiresDatetime()
public
setExpiresDatetime(DateTime|null $expiresDatetime) : $this
Parameters
- $expiresDatetime : 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
$thissetNote()
public
setNote(string|null $note) : $this
Parameters
- $note : string|null
Return values
$thissetQuantity()
public
setQuantity(string $quantity) : $this
Parameters
- $quantity : string
Return values
$thissetSourceId()
public
setSourceId(int $sourceId) : $this
Parameters
- $sourceId : int
Return values
$thissetSourceModule()
public
setSourceModule(int $sourceModule) : $this
Parameters
- $sourceModule : int
Return values
$thissetSourceType()
public
setSourceType(string $sourceType) : $this
Parameters
- $sourceType : string
Return values
$thissetStatus()
public
setStatus(int $status) : $this
Parameters
- $status : int
Return values
$thissetStockItemId()
public
setStockItemId(int|null $stockItemId) : $this
Parameters
- $stockItemId : int|null
Return values
$thissetUpdateDatetime()
public
setUpdateDatetime(DateTime|null $updateDatetime) : $this
Parameters
- $updateDatetime : DateTime|null
Return values
$thissetWarehouseId()
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>