yii\data\BaseDataProvider::prepare PHP Method

prepare() public method

This method will prepare the data models and keys that can be retrieved via BaseDataProvider::getModels and BaseDataProvider::getKeys. This method will be implicitly called by BaseDataProvider::getModels and BaseDataProvider::getKeys if it has not been called before.
public prepare ( boolean $forcePrepare = false )
$forcePrepare boolean whether to force data preparation even if it has been done before.
    public function prepare($forcePrepare = false)
    {
        if ($forcePrepare || $this->_models === null) {
            $this->_models = $this->prepareModels();
        }
        if ($forcePrepare || $this->_keys === null) {
            $this->_keys = $this->prepareKeys($this->_models);
        }
    }