Notification
extends Notification
in package
Admin variant of a notification (`cms_system_notifications`), hydrated from the Api endpoint `api/system/notification`. Flat entity (scalar FKs `userId` / `typeId`).
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_system_notifications'
- #[TableAlias]
- 'notification'
Table of Contents
Properties
- $errorCode : int|null
- $gridReceiver : string|null
- Recipient name for the list ("all admins" when there is no recipient); display only.
- $gridReceiverDestination : string|null
- Link target to the recipient (user edit); `null` means no link (no recipient or no privilege).
- $gridTargetDestination : string|null
- $id : int|null
- $insertDatetime : DateTime
- $itemId : int|null
- $notificationTypeId : int|null
- $read : bool
- $receiverUserId : int|null
- $shown : bool
- $status : int|null
- $text : 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.
- getErrorCode() : int|null
- getGridReceiver() : string|null
- getGridReceiverDestination() : string|null
- getGridTargetDestination() : string|null
- getId() : int|null
- getInsertDatetime() : DateTime
- getItemId() : int|null
- getNotificationTypeId() : int|null
- getRead() : bool
- getReceiverUserId() : int|null
- Returns the id of the user who received the record; `null` for an unknown or anonymous receiver.
- getShown() : bool
- getStatus() : int|null
- getText() : string|null
- isPersisted() : bool
- isRead() : bool
- isShown() : bool
- setErrorCode() : $this
- setGridReceiver() : self
- setGridReceiverDestination() : self
- setGridTargetDestination() : self
- setId() : $this
- setInsertDatetime() : $this
- setItemId() : $this
- setNotificationTypeId() : $this
- setRead() : $this
- setReceiverUserId() : $this
- setShown() : $this
- setStatus() : $this
- setText() : $this
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$errorCode
protected
int|null
$errorCode
= null
Attributes
- #[Column]
- $name: 'error_code'
- $type: 'integer'
- $nullable: true
$gridReceiver
Recipient name for the list ("all admins" when there is no recipient); display only.
protected
string|null
$gridReceiver
= null
Attributes
- #[Transient]
$gridReceiverDestination
Link target to the recipient (user edit); `null` means no link (no recipient or no privilege).
protected
string|null
$gridReceiverDestination
= null
Attributes
- #[Transient]
$gridTargetDestination
protected
string|null
$gridTargetDestination
= null
Attributes
- #[Transient]
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'notification_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$insertDatetime
protected
DateTime
$insertDatetime
= new DateTime()
Attributes
- #[Column]
- $name: 'insert_datetime'
- $type: 'datetime'
$itemId
protected
int|null
$itemId
= null
Attributes
- #[Column]
- $name: 'id'
- $type: 'integer'
- $nullable: true
$notificationTypeId
protected
int|null
$notificationTypeId
= null
Attributes
- #[Column]
- $name: 'cms_system_notification_types_notification_type_id'
- $type: 'integer'
- $nullable: true
- $options: ['unsigned' => true]
$read
protected
bool
$read
= false
Attributes
- #[Column]
- $name: '`read`'
- $type: 'boolean'
$receiverUserId
protected
int|null
$receiverUserId
= null
Attributes
- #[Column]
- $name: 'cms_system_users_user_id'
- $type: 'integer'
- $nullable: true
- $options: ['unsigned' => true]
$shown
protected
bool
$shown
= false
Attributes
- #[Column]
- $name: 'shown'
- $type: 'boolean'
$status
protected
int|null
$status
= null
Attributes
- #[Column]
- $name: 'status'
- $type: 'integer'
- $nullable: true
$text
protected
string|null
$text
= null
Attributes
- #[Column]
- $name: 'text'
- $type: 'text'
- $nullable: true
Methods
__construct()
public
__construct([int|null $id = null ][, int|null $notificationTypeId = null ][, int|null $receiverUserId = null ][, string|null $text = null ][, bool $read = false ][, bool $shown = false ][, int|null $itemId = null ][, int|null $status = null ][, int|null $errorCode = null ][, DateTime $insertDatetime = new DateTime() ]) : mixed
Parameters
- $id : int|null = null
- $notificationTypeId : int|null = null
- $receiverUserId : int|null = null
- $text : string|null = null
- $read : bool = false
- $shown : bool = false
- $itemId : int|null = null
- $status : int|null = null
- $errorCode : int|null = null
- $insertDatetime : DateTime = new DateTime()
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>getErrorCode()
public
getErrorCode() : int|null
Return values
int|nullgetGridReceiver()
public
getGridReceiver() : string|null
Return values
string|nullgetGridReceiverDestination()
public
getGridReceiverDestination() : string|null
Return values
string|nullgetGridTargetDestination()
public
getGridTargetDestination() : string|null
Return values
string|nullgetId()
public
getId() : int|null
Return values
int|nullgetInsertDatetime()
public
getInsertDatetime() : DateTime
Return values
DateTimegetItemId()
public
getItemId() : int|null
Return values
int|nullgetNotificationTypeId()
public
getNotificationTypeId() : int|null
Return values
int|nullgetRead()
public
getRead() : bool
Return values
boolgetReceiverUserId()
Returns the id of the user who received the record; `null` for an unknown or anonymous receiver.
public
getReceiverUserId() : int|null
Return values
int|nullgetShown()
public
getShown() : bool
Return values
boolgetStatus()
public
getStatus() : int|null
Return values
int|nullgetText()
public
getText() : string|null
Return values
string|nullisPersisted()
public
isPersisted() : bool
Return values
boolisRead()
public
isRead() : bool
Return values
boolisShown()
public
isShown() : bool
Return values
boolsetErrorCode()
public
setErrorCode(int|null $errorCode) : $this
Parameters
- $errorCode : int|null
Return values
$thissetGridReceiver()
public
setGridReceiver(string|null $receiver) : self
Parameters
- $receiver : string|null
Return values
selfsetGridReceiverDestination()
public
setGridReceiverDestination(string|null $destination) : self
Parameters
- $destination : string|null
Return values
selfsetGridTargetDestination()
public
setGridTargetDestination(string|null $destination) : self
Parameters
- $destination : string|null
Return values
selfsetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetInsertDatetime()
public
setInsertDatetime(DateTime $dt) : $this
Parameters
- $dt : DateTime
Return values
$thissetItemId()
public
setItemId(int|null $itemId) : $this
Parameters
- $itemId : int|null
Return values
$thissetNotificationTypeId()
public
setNotificationTypeId(int|null $notificationTypeId) : $this
Parameters
- $notificationTypeId : int|null
Return values
$thissetRead()
public
setRead(bool $read) : $this
Parameters
- $read : bool
Return values
$thissetReceiverUserId()
public
setReceiverUserId(int|null $receiverUserId) : $this
Parameters
- $receiverUserId : int|null
Return values
$thissetShown()
public
setShown(bool $shown) : $this
Parameters
- $shown : bool
Return values
$thissetStatus()
public
setStatus(int|null $status) : $this
Parameters
- $status : int|null
Return values
$thissetText()
public
setText(string|null $text) : $this
Parameters
- $text : 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>