FileItem 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
- copyTo() : Result<string|int, FileItem>
- getChatId() : int|null
- getContentType() : string
- Method for getting file type like in old api
- getContext() : Context
- Returns the local or global context for the action.
- getCopyToChat() : self|null
- getDiskFile() : File|null
- getDiskFileId() : int
- getDiskFileIdsFromBbCodesInText() : array<string|int, mixed>
- getId() : int|null
- Returns the id of the entity
- getMessageOut() : string
- 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
- initByDiskFileId() : self|null
- markAsFile() : self
- removeDiskBbCodesFromText() : string
- setChatId() : self
- setContentType() : self
- setContext() : self
- Sets new context for operations.
- setContextUser() : self
- setDiskFile() : 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|File $diskFile[, int|null $chatId = null ]) : mixed
Parameters
- $diskFile : int|File
- $chatId : int|null = null
copyTo()
public
copyTo(Folder $folder) : Result<string|int, FileItem>
Parameters
- $folder : Folder
Return values
Result<string|int, FileItem>getChatId()
public
getChatId() : int|null
Return values
int|nullgetContentType()
Method for getting file type like in old api
public
getContentType() : string
Tags
Return values
stringgetContext()
Returns the local or global context for the action.
public
getContext() : Context
Return values
ContextgetCopyToChat()
public
getCopyToChat(Chat $chat) : self|null
Parameters
- $chat : Chat
Return values
self|nullgetDiskFile()
public
getDiskFile() : File|null
Return values
File|nullgetDiskFileId()
public
getDiskFileId() : int
Return values
intgetDiskFileIdsFromBbCodesInText()
public
static getDiskFileIdsFromBbCodesInText(string $text) : array<string|int, mixed>
Parameters
- $text : string
Return values
array<string|int, mixed>getId()
Returns the id of the entity
public
getId() : int|null
Return values
int|nullgetMessageOut()
public
getMessageOut() : string
Return values
stringgetPopupData()
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
stringinitByDiskFileId()
public
static initByDiskFileId(int $diskFileId[, int|null $chatId = null ]) : self|null
Parameters
- $diskFileId : int
- $chatId : int|null = null
Return values
self|nullmarkAsFile()
public
markAsFile() : self
Return values
selfremoveDiskBbCodesFromText()
public
static removeDiskBbCodesFromText(string $text) : string
Parameters
- $text : string
Return values
stringsetChatId()
public
setChatId(int|null $chatId) : self
Parameters
- $chatId : int|null
Return values
selfsetContentType()
public
setContentType(string $contentType) : self
Parameters
- $contentType : string
Return values
selfsetContext()
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
selfsetDiskFile()
public
setDiskFile(File $diskFile) : self
Parameters
- $diskFile : File
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