This commit is contained in:
Graham Campbell
2014-12-20 21:20:17 +00:00
parent 26e4361d8a
commit 9d8d89248f
103 changed files with 2478 additions and 2353 deletions
@@ -4,23 +4,26 @@ namespace CachetHQ\Cachet\Repositories\Component;
use CachetHQ\Cachet\Repositories\EloquentRepository;
use Component;
use Exception;
class EloquentComponentRepository extends EloquentRepository implements ComponentRepository {
class EloquentComponentRepository extends EloquentRepository implements ComponentRepository
{
protected $model;
protected $model;
public function __construct(Component $model) {
$this->model = $model;
}
public function __construct(Component $model)
{
$this->model = $model;
}
public function create($user_id, array $array) {
$component = new $this->model($array);
$component->user_id = $user_id;
public function create($user_id, array $array)
{
$component = new $this->model($array);
$component->user_id = $user_id;
$this->validate($component);
$this->validate($component);
$component->saveOrFail();
return $component;
}
$component->saveOrFail();
return $component;
}
}