本文整理匯總了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);
}