부터: 1.0
저자: Buba Suma (bubasuma@gmail.com)
상속: extends yii\db\ActiveQuery
예제 #1
0
 /**
  * @param string $userId
  * @return ConversationQuery
  * @throws \yii\base\InvalidConfigException
  */
 public static function conversations($userId)
 {
     /**@var ConversationQuery $query * */
     $query = \Yii::createObject(ConversationQuery::className(), [get_called_class(), ['userId' => $userId]]);
     return $query->with(['newMessages' => function ($msg) use($userId) {
         /**@var $msg ConversationQuery * */
         $msg->andOnCondition(['receiver_id' => $userId])->select(['sender_id', 'COUNT(*) AS count']);
     }]);
 }
예제 #2
0
 /**
  * @return ConversationQuery
  * @throws \yii\base\InvalidConfigException
  */
 public static function find()
 {
     return Yii::createObject(ConversationQuery::className(), [get_called_class()]);
 }
예제 #3
0
 /**
  * @param string $userId
  * @return ConversationQuery
  * @throws \yii\base\InvalidConfigException
  */
 public static function conversations($userId)
 {
     return \Yii::createObject(ConversationQuery::className(), [get_called_class(), ['userId' => $userId]]);
 }