PHP 클래스 ConversationMessageModel, vanilla

상속: extends ConversationsModel
파일 보기 프로젝트 열기: vanilla/vanilla 1 사용 예제들

공개 메소드들

메소드 설명
__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