src/actions/Action.php
public function getCollection()
    {
        if ($this->parent) {
            return $this->parent->getCollection();
        }

        if (!is_object($this->_collection)) {
            $action = $this->controller->action;
            if ($action instanceof self) {
                $scenario = $action->getScenario();
            } else {
                $scenario = $action->id;
            }

            $this->_collection = Yii::createObject(ArrayHelper::merge([
                'class' => Collection::class,
                'model' => $this->controller->newModel(['scenario' => $scenario]),
                'scenario' => $scenario,
                'queryOptions' => $this->queryOptions,
            ], (array) $this->_collection));
        }

        return $this->_collection;
    }
public function getCollection()
    {
        if ($this->parent) {
            return $this->parent->getCollection();
        }

        if (!is_object($this->_collection)) {
            $action = $this->controller->action;
            if ($action instanceof self) {
                $scenario = $action->getScenario();
            } else {
                $scenario = $action->id;
            }

            $this->_collection = Yii::createObject(ArrayHelper::merge([
                'class' => Collection::class,
                'model' => $this->controller->newModel(['scenario' => $scenario]),
                'scenario' => $scenario,
                'queryOptions' => $this->queryOptions,
            ], (array) $this->_collection));
        }

        return $this->_collection;
    }
public function getCollection ( ) { if ( $ this -> parent ) { return $ this -> parent -> getCollection ( ) ; } if ( ! is_object ( $ this -> _collection ) ) { $ action = $ this -> controller -> action ; if ( $ action instanceof self ) { $ scenario = $ action -> getScenario ( ) ; } else { $ scenario = $ action -> id ; } $ this -> _collection = Yii :: createObject ( ArrayHelper :: merge ( [ 'class' => Collection :: class , 'model' => $ this -> controller -> newModel ( [ 'scenario' => $ scenario ] ) , 'scenario' => $ scenario , 'queryOptions' => $ this -> queryOptions , ] , ( array ) $ this -> _collection ) ) ; } return $ this -> _collection ; }
Gets the instance of the collection.

@return Collection
Gets the instance of the collection .