Files
cachet-docker/app/Repositories/Component/ComponentRepository.php
2015-05-25 17:53:06 +01:00

68 lines
1.5 KiB
PHP

<?php
/*
* This file is part of Cachet.
*
* (c) James Brooks <james@cachethq.io>
* (c) Joseph Cohen <joe@cachethq.io>
* (c) Graham Campbell <graham@cachethq.io>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CachetHQ\Cachet\Repositories\Component;
interface ComponentRepository
{
/**
* Returns all models.
*
* @return \Illuminate\Database\Eloquent\Collection
*/
public function all();
/**
* Create a new model.
*
* @param int $userId
* @param array $data
*
* @return \Illuminate\Database\Eloquent\Model
*/
public function create($userId, array $data);
/**
* Update a model by id.
*
* @param int $id
* @param array $data
*
* @return \Illuminate\Database\Eloquent\Model
*/
public function update($id, array $data);
/**
* Finds a model by id.
*
* @param int $id
*
* @throws \Illuminate\Database\Eloquent\ModelNotFoundException
*
* @return \Illuminate\Database\Eloquent\Model
*/
public function findOrFail($id);
/**
* Returns an object with related relationships.
*
* @param int $id
* @param string[] $with
*
* @throws \Illuminate\Database\Eloquent\ModelNotFoundException
*
* @return \Illuminate\Database\Eloquent\Model
*/
public function with($id, array $with = []);
}