PHP Class Nahid\Talk\Conversations\ConversationRepository

Inheritance: extends SebastianBerc\Repositories\Repository
Datei anzeigen Open project: nahid/talk Class Usage Examples

Public Methods

Method Description
existsById ( $id ) * check this given user is exists
getMessagesAllById ( $conversationId, $offset, $take ) * get all conversations with soft deleted message by given conversation id
getMessagesById ( $conversationId, $offset, $take ) * get all conversations by given conversation id
getMessagesById ( $conversationId, $userId, $offset, $take ) * get all conversations by given conversation id
isExistsAmongTwoUsers ( $user1, $user2 ) * check this given two users is already make a conversation
isUserExists ( $conversationId, $userId ) * check this given user is involved in this given $conversation
takeModel ( ) * this method is default method for repository package
threads ( $user, $offset, $take ) * retrieve all message thread without soft deleted message with latest one message and sender and receiver user model
threads ( $user, $order, $offset, $take ) * retrieve all message thread without soft deleted message with latest one message and sender and receiver user model
threadsAll ( $user, $offset, $take ) * retrieve all message thread with latest one message and sender and receiver user model

Method Details

existsById() public method

* check this given user is exists
public existsById ( $id )
$id

getMessagesAllById() public method

* get all conversations with soft deleted message by given conversation id
public getMessagesAllById ( $conversationId, $offset, $take )
$conversationId
$offset
$take

getMessagesById() public method

* get all conversations by given conversation id
public getMessagesById ( $conversationId, $offset, $take )
$conversationId
$offset
$take

getMessagesById() public method

* get all conversations by given conversation id
public getMessagesById ( $conversationId, $userId, $offset, $take )
$conversationId
$userId
$offset
$take

isExistsAmongTwoUsers() public method

* check this given two users is already make a conversation
public isExistsAmongTwoUsers ( $user1, $user2 )
$user1
$user2

isUserExists() public method

* check this given user is involved in this given $conversation
public isUserExists ( $conversationId, $userId )
$conversationId
$userId

takeModel() public method

* this method is default method for repository package
public takeModel ( )

threads() public method

* retrieve all message thread without soft deleted message with latest one message and sender and receiver user model
public threads ( $user, $offset, $take )
$user
$offset
$take

threads() public method

* retrieve all message thread without soft deleted message with latest one message and sender and receiver user model
public threads ( $user, $order, $offset, $take )
$user
$offset
$take

threadsAll() public method

* retrieve all message thread with latest one message and sender and receiver user model
public threadsAll ( $user, $offset, $take )
$user
$offset
$take