CoolCMS API

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]

$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'
#[ExternalReadonly]

$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]
#[ExternalReadonly]

$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|null

getGridReceiver()

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

getGridReceiverDestination()

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

getGridTargetDestination()

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

getInsertDatetime()

public getInsertDatetime() : DateTime
Return values
DateTime

getItemId()

public getItemId() : int|null
Return values
int|null

getNotificationTypeId()

public getNotificationTypeId() : int|null
Return values
int|null

getReceiverUserId()

Returns the id of the user who received the record; `null` for an unknown or anonymous receiver.

public getReceiverUserId() : int|null
Return values
int|null

getStatus()

public getStatus() : int|null
Return values
int|null

getText()

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

setErrorCode()

public setErrorCode(int|null $errorCode) : $this
Parameters
$errorCode : int|null
Return values
$this

setGridReceiver()

public setGridReceiver(string|null $receiver) : self
Parameters
$receiver : string|null
Return values
self

setGridReceiverDestination()

public setGridReceiverDestination(string|null $destination) : self
Parameters
$destination : string|null
Return values
self

setGridTargetDestination()

public setGridTargetDestination(string|null $destination) : self
Parameters
$destination : string|null
Return values
self

setId()

public setId(int|null $id) : $this
Parameters
$id : int|null
Return values
$this

setInsertDatetime()

public setInsertDatetime(DateTime $dt) : $this
Parameters
$dt : DateTime
Return values
$this

setItemId()

public setItemId(int|null $itemId) : $this
Parameters
$itemId : int|null
Return values
$this

setNotificationTypeId()

public setNotificationTypeId(int|null $notificationTypeId) : $this
Parameters
$notificationTypeId : int|null
Return values
$this

setRead()

public setRead(bool $read) : $this
Parameters
$read : bool
Return values
$this

setReceiverUserId()

public setReceiverUserId(int|null $receiverUserId) : $this
Parameters
$receiverUserId : int|null
Return values
$this

setShown()

public setShown(bool $shown) : $this
Parameters
$shown : bool
Return values
$this

setStatus()

public setStatus(int|null $status) : $this
Parameters
$status : int|null
Return values
$this

setText()

public setText(string|null $text) : $this
Parameters
$text : string|null
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