コード例 #1
0
ファイル: Repository.php プロジェクト: kamaroly/shift
 /**
  * Returns a new query object that can be used.
  *
  * @return mixed
  */
 protected function getQuery()
 {
     $query = $this->model->newInstance();
     if ($this->restrictByAccount) {
         $query->whereAccountId($this->currentAccountId());
     }
     return $query;
 }
コード例 #2
0
 /**
  * Create a resource based on the data provided.
  *
  * @param array $data
  *
  * @return Resource
  */
 public function getNew($data = [])
 {
     return $this->model->newInstance($data);
 }