Beispiel #1
0
 /**
  * Run the query and return the result
  * 
  * @param  array  $columns  
  * @return \Analogue\ORM\EntityCollection
  */
 public function get($columns = array('*'))
 {
     $entities = $this->getEntities($columns);
     // If we actually found models we will also eager load any relationships that
     // have been specified as needing to be eager loaded, which will solve the
     // n+1 query issue for the developers to avoid running a lot of queries.
     if (count($entities) > 0) {
         $entities = $this->eagerLoadRelations($entities);
     }
     return $this->entityMap->newCollection($entities);
 }