findMany() 공개 메소드

Find multiple models by their primary keys.
public findMany ( array $ids, array $columns = ['*'] ) : Illuminate\Database\Eloquent\Collection
$ids array
$columns array
리턴 Illuminate\Database\Eloquent\Collection
예제 #1
0
 /**
  * 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
0
 /**
  * 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);
 }
 /**
  * @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));
 }
 /**
  * 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);
 }