PHP Class ConversationMessageModel, vanilla

Inheritance: extends ConversationsModel
Afficher le fichier Open project: vanilla/vanilla Class Usage Examples

Méthodes publiques

Méthode Description
__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

Method Details

__construct() public méthode

Class constructor. Defines the related database table name.
Since: 2.0.0
public __construct ( )

get() public méthode

Deprecation:
public get ( $OrderFields = '', $OrderDirection = 'asc', $Limit = false, $PageNumber = false )

getCount() public méthode

Deprecation:
public getCount ( $wheres = [] )

getCountByConversation() public méthode

Get number of messages in a conversation.
Since: 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.
Résultat integer Number of messages.

getCountWhere() public méthode

Get number of messages that meet criteria.
Since: 2.0.0
public getCountWhere ( array $Wheres = '' ) : integer
$Wheres array SQL conditions.
Résultat integer Number of messages.

getID() public méthode

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.
Résultat Gdn_DataSet

getNew() public méthode

Get only new messages from conversation.
Since: 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.
Résultat Gdn_DataSet SQL results.

getRecent() public méthode

Events: BeforeGet.
Since: 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.
Résultat Gdn_DataSet SQL results.

instance() public static méthode

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

save() public méthode

Save message from form submission.
Since: 2.0.0
public save ( array $FormPostValues, $Conversation = null, $Options = [] ) : integer
$FormPostValues array Values submitted via form.
Résultat integer Unique ID of message created or updated.

validate() public méthode

public validate ( array $FormPostValues, boolean $Insert = false ) : boolean
$FormPostValues array
$Insert boolean
Résultat boolean