protected function getQuickSearchRelation($activeRelation, $scenario)
    {
        /** @var ActiveRecord $relationModel */
        $relationModel = new $activeRelation->modelClass();
        $relationModel->scenario = $scenario;

        $parts = explode('\\', $activeRelation->modelClass);
        $modelClass = array_pop($parts);
        $namespace = implode('\\', $parts);
        $searchModelClass = $namespace . '\\search\\' . $modelClass;
        $relationSearchModel = class_exists($searchModelClass) ? new $searchModelClass : new $activeRelation->modelClass;

        return [
            'model'      => $relationModel,
            'searchModel'=> $relationSearchModel,
            'attributes' => [],
        ];
    }
protected function getQuickSearchRelation($activeRelation, $scenario)
    {
        /** @var ActiveRecord $relationModel */
        $relationModel = new $activeRelation->modelClass();
        $relationModel->scenario = $scenario;

        $parts = explode('\\', $activeRelation->modelClass);
        $modelClass = array_pop($parts);
        $namespace = implode('\\', $parts);
        $searchModelClass = $namespace . '\\search\\' . $modelClass;
        $relationSearchModel = class_exists($searchModelClass) ? new $searchModelClass : new $activeRelation->modelClass;

        return [
            'model'      => $relationModel,
            'searchModel'=> $relationSearchModel,
            'attributes' => [],
        ];
    }
protected function getQuickSearchRelation ( $ activeRelation , $ scenario ) { /** @var ActiveRecord $relationModel */ $ relationModel = new $ activeRelation -> modelClass ( ) ; $ relationModel -> scenario = $ scenario ; $ parts = explode ( '\\' , $ activeRelation -> modelClass ) ; $ modelClass = array_pop ( $ parts ) ; $ namespace = implode ( '\\' , $ parts ) ; $ searchModelClass = $ namespace . '\\search\\' . $ modelClass ; $ relationSearchModel = class_exists ( $ searchModelClass ) ? new $ searchModelClass : new $ activeRelation -> modelClass ; return [ 'model' => $ relationModel , 'searchModel' => $ relationSearchModel , 'attributes' => [ ] , ] ; }
Gets the AR model and search model for specified relation.
@param \yii\db\ActiveQuery $activeRelation
@param string $scenario
@return array contains: model, searchModel and empty attributes array
Gets the AR model and search model for specified relation .