ViewItem implements RestEntity, PopupDataAggregatable uses ContextCustomer
Table of Contents
Interfaces
- RestEntity
- PopupDataAggregatable
- An interface for classes that have entities within them that should be taken to the top level of a REST response.
Methods
- __construct() : mixed
- getContext() : Context
- Returns the local or global context for the action.
- getDateView() : DateTime
- getId() : int|null
- Returns the id of the entity
- 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.
- getRestEntityName() : string
- Returns the name of the entity that will be used in the rest response
- getUserId() : int
- setContext() : self
- Sets new context for operations.
- setContextUser() : self
- toRestFormat() : array<string|int, mixed>|null
- Returns an array in JSON like format to return the entity as a rest response.
- withContext() : static
- Provides local context for the action.
- withContextUser() : static
- Provides local context for the action.
Methods
__construct()
public
__construct(int $id, int $messageId, int $userId, DateTime $dateView) : mixed
Parameters
- $id : int
- $messageId : int
- $userId : int
- $dateView : DateTime
getContext()
Returns the local or global context for the action.
public
getContext() : Context
Return values
ContextgetDateView()
public
getDateView() : DateTime
Return values
DateTimegetId()
Returns the id of the entity
public
getId() : int|null
Return values
int|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
PopupDatagetRestEntityName()
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
intsetContext()
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
selftoRestFormat()
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>|nullwithContext()
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