ComplaintStatus
extends BaseEntity
in package
implements
IdentifiableInterface
uses
IdentifiableTrait, TranslationCollectionTrait
AbstractYes
Complaint status: a node of a simple (negated) state graph, a single FK code list with no separate enum.
Behavioral flags read by ComplaintTransitionManager on a transition into this status:
sendEmail: sends an e-mail from the status template (ComplaintStatusText),returnStock: generates a stock return (DocumentService::receive()through ComplaintStockManager,SourceRef(4,'complaint',id)),final: terminal status (the expiration cron and the admin UI exclude it as a target).
Unlike OrderStatus there is no gating matrix (a complaint has no reservations, payments or
invoicing): the admin may switch to any status.
Tags
Attributes
- #[MappedSuperclass]
- #[TableAlias]
- $alias: 'complaintStatus'
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
- $class : string|null
- $final : bool
- $id : int|null
- $key : string|null
- $returnStock : bool
- $sendEmail : bool
- $translations : Collection<int, TTranslation>
Methods
- __construct() : mixed
- addTranslation() : $this
- 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.
- getClass() : string|null
- getFinal() : bool
- getId() : int|null
- getKey() : string|null
- getReturnStock() : bool
- getSendEmail() : bool
- getTranslation() : TTranslation|null
- getTranslations() : Collection<int, TTranslation>
- isPersisted() : bool
- removeTranslation() : $this
- setClass() : $this
- setFinal() : $this
- setId() : $this
- setKey() : $this
- setReturnStock() : $this
- setSendEmail() : $this
- setTranslations() : $this
- translationCollectionInit() : void
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$class
protected
string|null
$class
= null
Attributes
- #[Column]
- $name: 'class'
- $type: 'string'
- $length: 45
- $nullable: true
$final
protected
bool
$final
= false
Attributes
- #[Column]
- $name: 'final'
- $type: 'boolean'
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'complaint_status_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$key
protected
string|null
$key
= null
Attributes
- #[Column]
- $name: '`key`'
- $type: 'string'
- $length: 30
- $nullable: true
$returnStock
protected
bool
$returnStock
= false
Attributes
- #[Column]
- $name: 'return_stock'
- $type: 'boolean'
$sendEmail
protected
bool
$sendEmail
= false
Attributes
- #[Column]
- $name: 'send_email'
- $type: 'boolean'
$translations
protected
Collection<int, TTranslation>
$translations
= new ArrayCollection()
Methods
__construct()
public
__construct([int|null $id = null ][, string|null $key = null ][, string|null $class = null ][, bool $sendEmail = false ][, bool $returnStock = false ][, bool $final = false ][, Collection $translations = new ArrayCollection() ]) : mixed
Parameters
- $id : int|null = null
- $key : string|null = null
- $class : string|null = null
- $sendEmail : bool = false
- $returnStock : bool = false
- $final : bool = false
- $translations : Collection = new ArrayCollection()
addTranslation()
public
addTranslation(TTranslation $translation) : $this
Parameters
- $translation : TTranslation
Return values
$thiscallInitMethods()
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>getClass()
public
getClass() : string|null
Return values
string|nullgetFinal()
public
getFinal() : bool
Return values
boolgetId()
public
getId() : int|null
Return values
int|nullgetKey()
public
getKey() : string|null
Return values
string|nullgetReturnStock()
public
getReturnStock() : bool
Return values
boolgetSendEmail()
public
getSendEmail() : bool
Return values
boolgetTranslation()
public
getTranslation(int $langId) : TTranslation|null
Parameters
- $langId : int
Return values
TTranslation|nullgetTranslations()
public
getTranslations() : Collection<int, TTranslation>
Return values
Collection<int, TTranslation>isPersisted()
public
isPersisted() : bool
Return values
boolremoveTranslation()
public
removeTranslation(TTranslation $translation) : $this
Parameters
- $translation : TTranslation
Return values
$thissetClass()
public
setClass(string|null $class) : $this
Parameters
- $class : string|null
Return values
$thissetFinal()
public
setFinal(bool $final) : $this
Parameters
- $final : bool
Return values
$thissetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetKey()
public
setKey(string|null $key) : $this
Parameters
- $key : string|null
Return values
$thissetReturnStock()
public
setReturnStock(bool $returnStock) : $this
Parameters
- $returnStock : bool
Return values
$thissetSendEmail()
public
setSendEmail(bool $sendEmail) : $this
Parameters
- $sendEmail : bool
Return values
$thissetTranslations()
public
setTranslations(Collection<int, TTranslation>|array<int, TTranslation> $translations) : $this
Parameters
- $translations : Collection<int, TTranslation>|array<int, TTranslation>
Return values
$thistranslationCollectionInit()
public
translationCollectionInit() : void
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>