Documentation

ApprovableTrait

A trait which provides basic (repeated) functionality for approvable entities.

TODO: Make activities also use this trait.

Tags
psalm-type

ApprovableTraitGdprArrayType = array{ id: int, approved: int, approvedAt: ?string, approvableText: ?string, }

Table of Contents

Properties

$approvableText  : ApprovableText|null
When the entity has been approved/rejected a message can be attached. Since we do not always need this message it has been replaced with another entity which we can EXTRA_LAZY load to ensure it is not always included.
$approved  : ApprovableStatus
State of the approval.
$approvedAt  : DateTime|null
The date when the entity was approved.
$approver  : Member|null
Who (dis)approved the entity using this trait?

Methods

getApprovableText()  : ApprovableText|null
getApproved()  : ApprovableStatus
getApprovedAt()  : DateTime|null
getApprover()  : Member|null
isApproved()  : bool
setApprovableText()  : void
setApproved()  : void
setApprovedAt()  : void
setApprover()  : void
toGdprArray()  : ApprovableTraitGdprArrayType

Properties

$approvableText

When the entity has been approved/rejected a message can be attached. Since we do not always need this message it has been replaced with another entity which we can EXTRA_LAZY load to ensure it is not always included.

protected ApprovableText|null $approvableText = null
Attributes
#[JoinColumn]
$name: 'approvableText_id'
$referencedColumnName: 'id'
$nullable: true
#[OneToOne]
$targetEntity: \Application\Model\ApprovableText::class
$cascade: ['persist', 'remove']
$fetch: 'EXTRA_LAZY'
$orphanRemoval: true

$approved

State of the approval.

protected ApprovableStatus $approved
Attributes
#[Column]
$type: 'integer'
$enumType: \Application\Model\Enums\ApprovableStatus::class

$approvedAt

The date when the entity was approved.

protected DateTime|null $approvedAt = null
Attributes
#[Column]
$type: 'datetime'
$nullable: true

$approver

Who (dis)approved the entity using this trait?

protected Member|null $approver = null
Attributes
#[JoinColumn]
$referencedColumnName: 'lidnr'
#[ManyToOne]
$targetEntity: \Decision\Model\Member::class

Methods

getApprovedAt()

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

setApprovedAt()

public setApprovedAt(DateTime|null $approvedAt) : void
Parameters
$approvedAt : DateTime|null

toGdprArray()

public toGdprArray() : ApprovableTraitGdprArrayType
Return values
ApprovableTraitGdprArrayType

        
On this page

Search results