示例#1
0
 /**
  * Get the hydrated models.
  *
  * @return array
  */
 public function getModels()
 {
     $results = $this->query->get();
     $connection = $this->model->getConnectionName();
     return $this->model->hydrate($results, $connection)->all();
 }
 /**
  * Perform booting of services.
  *
  * @return void
  */
 public function boot()
 {
     Model::setConnectionResolver($this->app['db']);
 }
示例#3
0
 /**
  * Set the model instance being queried.
  *
  * @param \Magister\Services\Database\Elegant\Model $model
  *
  * @return $this
  */
 public function setModel(Model $model)
 {
     $this->model = $model;
     $this->query->from($model->getUrl());
     return $this;
 }