frontend/models/search/ConferencesSearch.php
/**
     * Creates data provider instance with search query applied
     * @param integer $user_id
     * @return ActiveDataProvider
     */
Creates data provider instance with search query applied
@param integer $user_id
@return ActiveDataProvider
Creates data provider instance with search query applied @param integer $user_id @return ActiveDataProvider
public function search($user_id)
    {
        $query = self::find()
            ->select('t1.*, t2.participant_email, t2.participant_status, t2.user_id as your_user_id')
            ->alias('t1')
            ->innerJoin('{{%conference_participants}} as t2', 't1.conference_id = t2.conference_id')
            ->where([
                't2.user_id' => $user_id,
                't2.participant_status' => [
                    ConferenceParticipants::STATUS_OWNER,
                    ConferenceParticipants::STATUS_JOINED,
                ],
            ]);
        $dataProvider = new ActiveDataProvider([
            'query' => $query,
            'sort'=> [
                'defaultOrder' => ['conference_name'=>SORT_ASC],
                'attributes' => [
                    'conference_name',
                ]
            ],
            'pagination' => false,
        ]);
        if (!$this->validate()) {
            return $dataProvider;
        }
        return $dataProvider;
    }
public function search ( $ user_id ) { $ query = self :: find ( ) -> select ( 't1.*, t2.participant_email, t2.participant_status, t2.user_id as your_user_id' ) -> alias ( 't1' ) -> innerJoin ( '{{%conference_participants}} as t2' , 't1.conference_id = t2.conference_id' ) -> where ( [ 't2.user_id' => $ user_id , 't2.participant_status' => [ ConferenceParticipants :: STATUS_OWNER , ConferenceParticipants :: STATUS_JOINED , ] , ] ) ; $ dataProvider = new ActiveDataProvider ( [ 'query' => $ query , 'sort' => [ 'defaultOrder' => [ 'conference_name' => SORT_ASC ] , 'attributes' => [ 'conference_name' , ] ] , 'pagination' => false , ] ) ; if ( ! $ this -> validate ( ) ) { return $ dataProvider ; } return $ dataProvider ; }
Creates data provider instance with search query applied
 @param integer $user_id
 @return ActiveDataProvider
Creates data provider instance with search query applied @param integer $user_id @return ActiveDataProvider
//ConferenceParticipants::STATUS_INVITED, // add conditions that should always apply here //self::countToRedis($user_id, 0); //            'pagination' => [ //                'pageSize' => 17, //            ], // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1');