本文整理汇总了PHP中yii\data\ActiveDataProvider::prepareModels方法的典型用法代码示例。如果您正苦于以下问题:PHP ActiveDataProvider::prepareModels方法的具体用法?PHP ActiveDataProvider::prepareModels怎么用?PHP ActiveDataProvider::prepareModels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\data\ActiveDataProvider
的用法示例。
在下文中一共展示了ActiveDataProvider::prepareModels方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareModels
protected function prepareModels()
{
if ($refinerSet = $this->getRefinerSet()) {
$refinerSet->applyTo($this->query);
}
return parent::prepareModels();
}
示例2: prepareModels
/**
* @inheritdoc
*/
protected function prepareModels()
{
$this->setPagination(['pageParam' => $this->pageParam, 'pageSizeParam' => $this->pageSizeParam]);
$this->setSort(['sortParam' => $this->sortParam, 'enableMultiSort' => true]);
$this->setFilter();
return parent::prepareModels();
}
示例3: prepareModels
/**
* @inheritdoc
*/
protected function prepareModels()
{
$origQuery = $this->query;
$this->modifyQuery($this->query);
$r = parent::prepareModels();
$this->query = $origQuery;
return $r;
}
示例4: prepareModels
/**
* @inheritdoc
*/
protected function prepareModels()
{
$models = parent::prepareModels();
if (null !== $this->formatter) {
foreach ($models as $index => $model) {
$models[$index] = call_user_func($this->formatter, $model);
}
}
return $models;
}
示例5: prepareModels
protected function prepareModels()
{
return array_map([$this->module, 'attachBehaviorsToModel'], parent::prepareModels());
}
示例6: prepareModels
/**
* @inheritdoc
*/
protected function prepareModels()
{
$models = parent::prepareModels();
return array_map($this->mapFunction, $models);
}