src/ngrest/base/Api.php
public function prepareListQuery()
    {
        /* @var $modelClass \yii\db\BaseActiveRecord */
        $modelClass = $this->modelClass;

        $find = $modelClass::ngRestFind();

        // check if a pool id is requested:
        $this->appendPoolWhereCondition($find);

        // add tags condition
        $tagIds = Yii::$app->request->get('tags');
        if ($tagIds) {
            $subQuery = clone $find;
            $inQuery = $subQuery->joinWith(['tags tags'])->andWhere(['tags.id' => array_unique(explode(",", $tagIds))])->select(['pk_id']);
            $find->andWhere(['in', $modelClass::primaryKey(), $inQuery]);
        }

        return $find->with($this->getWithRelation('list'));
    }
public function prepareListQuery()
    {
        /* @var $modelClass \yii\db\BaseActiveRecord */
        $modelClass = $this->modelClass;

        $find = $modelClass::ngRestFind();

        // check if a pool id is requested:
        $this->appendPoolWhereCondition($find);

        // add tags condition
        $tagIds = Yii::$app->request->get('tags');
        if ($tagIds) {
            $subQuery = clone $find;
            $inQuery = $subQuery->joinWith(['tags tags'])->andWhere(['tags.id' => array_unique(explode(",", $tagIds))])->select(['pk_id']);
            $find->andWhere(['in', $modelClass::primaryKey(), $inQuery]);
        }

        return $find->with($this->getWithRelation('list'));
    }
public function prepareListQuery ( ) { /* @var $modelClass \yii\db\BaseActiveRecord */ $ modelClass = $ this -> modelClass ; $ find = $ modelClass :: ngRestFind ( ) ; // check if a pool id is requested: $ this -> appendPoolWhereCondition ( $ find ) ; // add tags condition $ tagIds = Yii :: $ app -> request -> get ( 'tags' ) ; if ( $ tagIds ) { $ subQuery = clone $ find ; $ inQuery = $ subQuery -> joinWith ( [ 'tags tags' ] ) -> andWhere ( [ 'tags.id' => array_unique ( explode ( "," , $ tagIds ) ) ] ) -> select ( [ 'pk_id' ] ) ; $ find -> andWhere ( [ 'in' , $ modelClass :: primaryKey ( ) , $ inQuery ] ) ; } return $ find -> with ( $ this -> getWithRelation ( 'list' ) ) ; }
Prepare the NgRest List Query.

> This will call the `ngRestFind()` method of the model.

Use in list, export

@see {{prepareIndexQuery()}}
@return \yii\db\ActiveQuery
@since 1.2.2
Prepare the NgRest List Query .