CoolCMS API

Warehouse extends BaseEntity
in package
implements IdentifiableInterface uses IdentifiableTrait, TranslationCollectionTrait

AbstractYes
Tags
template
Attributes
#[MappedSuperclass]
#[TableAlias]
$alias: 'warehouse'

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

$activated  : bool
$attributeClass  : string|null
$code  : string
$deliveryDays  : int
$id  : int|null
$insertDatetime  : DateTime
$order  : int
$translations  : Collection<int, TTranslation>
$vacationAffected  : bool
Whether the global shipping exclusion window (vacation) affects this warehouse.

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.
getAttributeClass()  : string|null
getCode()  : string
getDeliveryDays()  : int
getId()  : int|null
getInsertDatetime()  : DateTime
getOrder()  : int
getTranslation()  : TTranslation|null
getTranslations()  : Collection<int, TTranslation>
getVacationAffected()  : bool
isActivated()  : bool
isPersisted()  : bool
isVacationAffected()  : bool
removeTranslation()  : $this
setActivated()  : $this
setAttributeClass()  : $this
setCode()  : $this
setDeliveryDays()  : $this
setId()  : $this
setInsertDatetime()  : $this
setOrder()  : $this
setTranslations()  : $this
setVacationAffected()  : $this
translationCollectionInit()  : void
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Properties

$attributeClass

protected string|null $attributeClass = null
Attributes
#[Column]
$name: 'attribute_class'
$type: 'string'
$length: 100
$nullable: true

$code

protected string $code = ''
Attributes
#[Column]
$name: 'code'
$type: 'string'
$length: 30

$deliveryDays

protected int $deliveryDays = 0
Attributes
#[Column]
$name: 'delivery_days'
$type: 'integer'
$options: ['unsigned' => true]

$id

protected int|null $id = null
Attributes
#[Column]
$name: 'warehouse_id'
$type: 'integer'
$options: ['unsigned' => true]
#[GeneratedValue]
#[Id]

$insertDatetime

protected DateTime $insertDatetime = new DateTime()
Attributes
#[Column]
$name: 'insert_datetime'
$type: 'datetime'
#[ExternalReadonly]

$order

protected int $order = 1
Attributes
#[Column]
$name: '`order`'
$type: 'integer'
$options: ['unsigned' => true]

$translations

protected Collection<int, TTranslation> $translations = new ArrayCollection()

$vacationAffected

Whether the global shipping exclusion window (vacation) affects this warehouse.

protected bool $vacationAffected = true

true shifts its dispatch day (default, backward compatible); false keeps dispatching during the vacation and leaves its deliveryDays unshifted. StockReader applies the shift per warehouse before taking min(delivery_days).

NOTE: intentionally without #[ExternalReadonly]: this is admin configuration of the warehouse (like code, deliveryDays, order, attributeClass), not a trust-named scalar or server-controlled state. External writes to Store are rejected in the presenter anyway (DenyExternalMutationTrait).

Attributes
#[Column]
$name: 'vacation_affected'
$type: 'boolean'
$options: ['default' => 1]

Methods

__construct()

public __construct([int|null $id = null ][, string $code = '' ][, int $deliveryDays = 0 ][, string|null $attributeClass = null ][, int $order = 1 ][, bool $activated = true ][, bool $vacationAffected = true ][, DateTime $insertDatetime = new DateTime() ][, Collection $translations = new ArrayCollection() ]) : mixed
Parameters
$id : int|null = null
$code : string = ''
$deliveryDays : int = 0
$attributeClass : string|null = null
$order : int = 1
$activated : bool = true
$vacationAffected : bool = true
$insertDatetime : DateTime = new DateTime()
$translations : Collection = new ArrayCollection()

addTranslation()

public addTranslation(TTranslation $translation) : $this
Parameters
$translation : TTranslation
Return values
$this

callInitMethods()

Calls `init{TraitName}()` for every used trait that defines such a method.

public callInitMethods() : void

getActivated()

public getActivated() : bool
Return values
bool

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>

getAttributeClass()

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

getCode()

public getCode() : string
Return values
string

getDeliveryDays()

public getDeliveryDays() : int
Return values
int

getInsertDatetime()

public getInsertDatetime() : DateTime
Return values
DateTime

getOrder()

public getOrder() : int
Return values
int

getTranslation()

public getTranslation(int $langId) : TTranslation|null
Parameters
$langId : int
Return values
TTranslation|null

getTranslations()

public getTranslations() : Collection<int, TTranslation>
Return values
Collection<int, TTranslation>

getVacationAffected()

public getVacationAffected() : bool
Return values
bool

isActivated()

public isActivated() : bool
Return values
bool

isVacationAffected()

public isVacationAffected() : bool
Return values
bool

removeTranslation()

public removeTranslation(TTranslation $translation) : $this
Parameters
$translation : TTranslation
Return values
$this

setActivated()

public setActivated(bool $activated) : $this
Parameters
$activated : bool
Return values
$this

setAttributeClass()

public setAttributeClass(string|null $attributeClass) : $this
Parameters
$attributeClass : string|null
Return values
$this

setCode()

public setCode(string $code) : $this
Parameters
$code : string
Return values
$this

setDeliveryDays()

public setDeliveryDays(int $deliveryDays) : $this
Parameters
$deliveryDays : int
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

setOrder()

public setOrder(int $order) : $this
Parameters
$order : int
Return values
$this

setTranslations()

public setTranslations(Collection<int, TTranslation>|array<int, TTranslation> $translations) : $this
Parameters
$translations : Collection<int, TTranslation>|array<int, TTranslation>
Return values
$this

setVacationAffected()

public setVacationAffected(bool $vacationAffected) : $this
Parameters
$vacationAffected : bool
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