ReactionItem implements RegistryEntry, ActiveRecord, RestConvertible, PopupDataAggregatable uses ContextCustomer, RegistryEntryImplementation, ActiveRecordImplementation
Table of Contents
Interfaces
- RegistryEntry
- ActiveRecord
- RestConvertible
- PopupDataAggregatable
- An interface for classes that have entities within them that should be taken to the top level of a REST response.
Constants
- ALLOWED_REACTION = [self::LIKE, self::KISS, self::LAUGH, self::WONDER, self::CRY, self::ANGRY, self::FACEPALM]
- ANGRY = 'ANGRY'
- CRY = 'CRY'
- FACEPALM = 'FACEPALM'
- KISS = 'KISS'
- LAUGH = 'LAUGH'
- LIKE = 'LIKE'
- WONDER = 'WONDER'
Methods
- __construct() : mixed
- beforeSaveReaction() : Result
- delete() : Result
- fill() : static
- Fills object's fields with provided values.
- fillActual() : self
- getByMessage() : self|null
- getChatId() : int
- getContext() : Context
- Returns the local or global context for the action.
- getDataClass() : string
- Returns ORM tablet class name.
- getDataEntity() : EntityObject
- getDateCreate() : DateTime
- getDefaultDateCreate() : DateTime
- getDefaultReaction() : string
- getLocName() : string|null
- getMessageId() : int
- getPopupData() : PopupData
- Returns the data to be raised to the top of the REST response. Works on the principle of the composite pattern.
- getPrimaryId() : int|null
- getReaction() : string
- getRegistry() : Registry|null
- Return link of the object's registry.
- getRestEntityName() : string
- Returns the name of the entity that will be used in the rest response
- getUserId() : int
- isChanged() : bool
- Tells true if object has been changed.
- isDeleted() : bool
- Tells true if object marked to drop.
- load() : Result
- markChanged() : static
- Marks object changed.
- markDrop() : static
- Marks object to drop on save.
- onAfterOrmUpdate() : self
- prepareFields() : Result
- save() : Result
- setChatId() : ReactionItem
- setContext() : self
- Sets new context for operations.
- setContextUser() : self
- setDateCreate() : ReactionItem
- setMessageId() : ReactionItem
- setPrimaryId() : self
- setReaction() : ReactionItem
- setRegistry() : self
- setUserId() : ReactionItem
- toArray() : array<string|int, mixed>
- Returns object state as array.
- toRestFormat() : array<string|int, mixed>|null
- Returns an array in JSON like format to return the entity as a rest response.
- validateReaction() : Result
- withContext() : static
- Provides local context for the action.
- withContextUser() : static
- Provides local context for the action.
Constants
ALLOWED_REACTION
public
mixed
ALLOWED_REACTION
= [self::LIKE, self::KISS, self::LAUGH, self::WONDER, self::CRY, self::ANGRY, self::FACEPALM]
ANGRY
public
mixed
ANGRY
= 'ANGRY'
CRY
public
mixed
CRY
= 'CRY'
FACEPALM
public
mixed
FACEPALM
= 'FACEPALM'
KISS
public
mixed
KISS
= 'KISS'
LAUGH
public
mixed
LAUGH
= 'LAUGH'
LIKE
public
mixed
LIKE
= 'LIKE'
WONDER
public
mixed
WONDER
= 'WONDER'
Methods
__construct()
public
__construct([mixed $source = null ]) : mixed
Parameters
- $source : mixed = null
beforeSaveReaction()
public
beforeSaveReaction() : Result
Return values
Resultdelete()
public
delete() : Result
Return values
Resultfill()
Fills object's fields with provided values.
public
fill(array<string|int, mixed> $source) : static
Parameters
- $source : array<string|int, mixed>
Return values
staticfillActual()
public
fillActual(array<string|int, mixed> $fieldsToFill) : self
Parameters
- $fieldsToFill : array<string|int, mixed>
Return values
selfgetByMessage()
public
static getByMessage(int $messageId, string $reaction, int $userId) : self|null
Parameters
- $messageId : int
- $reaction : string
- $userId : int
Return values
self|nullgetChatId()
public
getChatId() : int
Return values
intgetContext()
Returns the local or global context for the action.
public
getContext() : Context
Return values
ContextgetDataClass()
Returns ORM tablet class name.
public
static getDataClass() : string
Return values
stringgetDataEntity()
public
getDataEntity() : EntityObject
Return values
EntityObjectgetDateCreate()
public
getDateCreate() : DateTime
Return values
DateTimegetDefaultDateCreate()
public
getDefaultDateCreate() : DateTime
Return values
DateTimegetDefaultReaction()
public
getDefaultReaction() : string
Return values
stringgetLocName()
public
getLocName([string|null $languageId = null ]) : string|null
Parameters
- $languageId : string|null = null
Return values
string|nullgetMessageId()
public
getMessageId() : int
Return values
intgetPopupData()
Returns the data to be raised to the top of the REST response. Works on the principle of the composite pattern.
public
getPopupData([array<string|int, mixed> $excludedList = [] ]) : PopupData
Parameters
- $excludedList : array<string|int, mixed> = []
Return values
PopupDatagetPrimaryId()
public
getPrimaryId() : int|null
Return values
int|nullgetReaction()
public
getReaction() : string
Return values
stringgetRegistry()
Return link of the object's registry.
public
getRegistry() : Registry|null
Return values
Registry|nullgetRestEntityName()
Returns the name of the entity that will be used in the rest response
public
static getRestEntityName() : string
Return values
stringgetUserId()
public
getUserId() : int
Return values
intisChanged()
Tells true if object has been changed.
public
isChanged() : bool
Return values
boolisDeleted()
Tells true if object marked to drop.
public
isDeleted() : bool
Return values
boolload()
public
load(int|array<string|int, mixed>|EntityObject $source) : Result
Parameters
- $source : int|array<string|int, mixed>|EntityObject
Return values
ResultmarkChanged()
Marks object changed.
public
markChanged([bool|null $state = null ]) : static
Parameters
- $state : bool|null = null
Return values
staticmarkDrop()
Marks object to drop on save.
public
markDrop() : static
Return values
staticonAfterOrmUpdate()
public
onAfterOrmUpdate(array<string|int, mixed> $fields) : self
Parameters
- $fields : array<string|int, mixed>
Return values
selfprepareFields()
public
prepareFields() : Result
Return values
Resultsave()
public
save() : Result
Return values
ResultsetChatId()
public
setChatId(int $chatId) : ReactionItem
Parameters
- $chatId : int
Return values
ReactionItemsetContext()
Sets new context for operations.
public
setContext(Context|null $context) : self
Parameters
- $context : Context|null
Return values
selfsetContextUser()
public
setContextUser(mixed $user) : self
Parameters
- $user : mixed
Return values
selfsetDateCreate()
public
setDateCreate(DateTime $dateCreate) : ReactionItem
Parameters
- $dateCreate : DateTime
Return values
ReactionItemsetMessageId()
public
setMessageId(int $messageId) : ReactionItem
Parameters
- $messageId : int
Return values
ReactionItemsetPrimaryId()
public
setPrimaryId(int $primaryId) : self
Parameters
- $primaryId : int
Return values
selfsetReaction()
public
setReaction(string $reaction) : ReactionItem
Parameters
- $reaction : string
Return values
ReactionItemsetRegistry()
public
setRegistry(Registry $registry) : self
Parameters
- $registry : Registry
Return values
selfsetUserId()
public
setUserId(int $userId) : ReactionItem
Parameters
- $userId : int
Return values
ReactionItemtoArray()
Returns object state as array.
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>toRestFormat()
Returns an array in JSON like format to return the entity as a rest response.
public
toRestFormat([array<string|int, mixed> $option = [] ]) : array<string|int, mixed>|null
Parameters
- $option : array<string|int, mixed> = []
Return values
array<string|int, mixed>|nullvalidateReaction()
public
static validateReaction(string $reaction) : Result
Parameters
- $reaction : string
Return values
ResultwithContext()
Provides local context for the action.
public
withContext(Context|null $context) : static
Parameters
- $context : Context|null
Return values
staticwithContextUser()
Provides local context for the action.
public
withContextUser(int|User|User $user) : static
Parameters
- $user : int|User|User