本文整理汇总了PHP中Illuminate\Database\Eloquent\Builder::findMany方法的典型用法代码示例。如果您正苦于以下问题:PHP Builder::findMany方法的具体用法?PHP Builder::findMany怎么用?PHP Builder::findMany使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Database\Eloquent\Builder
的用法示例。
在下文中一共展示了Builder::findMany方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: findMany
/**
* Find a model by its primary key.
*
* @param array $ids
* @param array $columns
*
* @return \Illuminate\Database\Eloquent\Collection
*/
public function findMany($ids, $columns = ['*'])
{
if (empty($ids)) {
return $this->model->newCollection();
}
return $this->model->newCollection(Cache::tags($this->model->getTable())->rememberMany($ids, $this->model->cacheExpiry, function ($ids) use($columns) {
return parent::findMany($ids, $columns)->all();
}));
}
示例2: findMany
/**
* Find a model by its primary key.
*
* @param array $ids
* @param array $columns
* @return \Illuminate\Database\Eloquent\Collection
* @static
*/
public static function findMany($ids, $columns = array())
{
return \Illuminate\Database\Eloquent\Builder::findMany($ids, $columns);
}
示例3: findMany
/**
* @param Builder $builder
* @param Collection $filters
* @return EloquentCollection
*/
protected function findMany(Builder $builder, Collection $filters)
{
$ids = $filters->get($this->getFindManyKey());
return $builder->findMany($this->normalizeIds($ids));
}
示例4: findMany
/**
* Find a model by its primary key.
*
* @param array $ids
* @param array $columns
* @return \Illuminate\Database\Eloquent\Collection
*/
public function findMany($ids, $columns = ['*'])
{
$results = $this->model->findMany($ids, $columns);
$this->reset();
return $this->hookFindMany($results);
}