bubasuma\simplechat\db\Conversation::baseQuery PHP Method

baseQuery() protected static method

protected static baseQuery ( integer $userId ) : ConversationQuery
$userId integer
return ConversationQuery
    protected static function baseQuery($userId)
    {
        return static::find()->forUser($userId)->addSelect(['user_id' => new Expression(':userId')])->with('lastMessage')->orderBy(['last_message_id' => SORT_DESC]);
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @inheritDoc
  */
 protected static function baseQuery($userId)
 {
     return parent::baseQuery($userId)->with(['newMessages', 'contact.profile']);
 }