PHP Класс ConversationMessageModel, vanilla

Наследование: extends ConversationsModel
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( ) Class constructor. Defines the related database table name.
get ( $OrderFields = '', $OrderDirection = 'asc', $Limit = false, $PageNumber = false )
getCount ( $wheres = [] )
getCountByConversation ( integer $ConversationID, integer $ViewingUserID, array $Wheres = '' ) : integer Get number of messages in a conversation.
getCountWhere ( array $Wheres = '' ) : integer Get number of messages that meet criteria.
getID ( mixed $ID, string $DatasetType = false, array $options = [] ) : Gdn_DataSet Get the data from the model based on its primary key.
getNew ( integer $ConversationID, integer $LastMessageID ) : Gdn_DataSet Get only new messages from conversation.
getRecent ( integer $ConversationID, integer $ViewingUserID, integer $Offset = '0', integer $Limit = '', array $Wheres = '' ) : Gdn_DataSet Get messages by conversation.
instance ( ) Return the singleton instance of this class.
save ( array $FormPostValues, $Conversation = null, $Options = [] ) : integer Save message from form submission.
validate ( array $FormPostValues, boolean $Insert = false ) : boolean

Описание методов

__construct() публичный Метод

Class constructor. Defines the related database table name.
С версии: 2.0.0
public __construct ( )

get() публичный Метод

Устаревший:
public get ( $OrderFields = '', $OrderDirection = 'asc', $Limit = false, $PageNumber = false )

getCount() публичный Метод

Устаревший:
public getCount ( $wheres = [] )

getCountByConversation() публичный Метод

Get number of messages in a conversation.
С версии: 2.0.0
public getCountByConversation ( integer $ConversationID, integer $ViewingUserID, array $Wheres = '' ) : integer
$ConversationID integer Unique ID of conversation being viewed.
$ViewingUserID integer Unique ID of current user.
$Wheres array SQL conditions.
Результат integer Number of messages.

getCountWhere() публичный Метод

Get number of messages that meet criteria.
С версии: 2.0.0
public getCountWhere ( array $Wheres = '' ) : integer
$Wheres array SQL conditions.
Результат integer Number of messages.

getID() публичный Метод

Get the data from the model based on its primary key.
public getID ( mixed $ID, string $DatasetType = false, array $options = [] ) : Gdn_DataSet
$ID mixed The value of the primary key in the database.
$DatasetType string The format of the result dataset.
$options array Not used.
Результат Gdn_DataSet

getNew() публичный Метод

Get only new messages from conversation.
С версии: 2.0.0
public getNew ( integer $ConversationID, integer $LastMessageID ) : Gdn_DataSet
$ConversationID integer Unique ID of conversation being viewed.
$LastMessageID integer Unique ID of last message to be viewed.
Результат Gdn_DataSet SQL results.

getRecent() публичный Метод

Events: BeforeGet.
С версии: 2.0.0
public getRecent ( integer $ConversationID, integer $ViewingUserID, integer $Offset = '0', integer $Limit = '', array $Wheres = '' ) : Gdn_DataSet
$ConversationID integer Unique ID of conversation being viewed.
$ViewingUserID integer Unique ID of current user.
$Offset integer Number to skip.
$Limit integer Maximum to return.
$Wheres array SQL conditions.
Результат Gdn_DataSet SQL results.

instance() публичный статический Метод

Return the singleton instance of this class.
public static instance ( )

save() публичный Метод

Save message from form submission.
С версии: 2.0.0
public save ( array $FormPostValues, $Conversation = null, $Options = [] ) : integer
$FormPostValues array Values submitted via form.
Результат integer Unique ID of message created or updated.

validate() публичный Метод

public validate ( array $FormPostValues, boolean $Insert = false ) : boolean
$FormPostValues array
$Insert boolean
Результат boolean