Example #1
0
 /**
  * Get the hydrated models.
  *
  * @param  array  $results
  * @return \October\Rain\Halcyon\Model[]
  */
 public function getModels(array $results)
 {
     $datasource = $this->model->getDatasourceName();
     $models = $this->model->hydrate($results, $datasource);
     /*
      * Flag the models as loaded from cache, then reset the internal property.
      */
     if ($this->loadedFromCache) {
         $models->each(function ($model) {
             $model->setLoadedFromCache($this->loadedFromCache);
         });
         $this->loadedFromCache = false;
     }
     return $models->all();
 }