BaseRepository.php 755 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
<?php namespace Modules\Core\Repositories;

/**
 * Interface CoreRepository
 * @package Modules\Core\Repositories
 */
interface BaseRepository
{
    /**
10 11
     * @param int $id
     * @return $model
12 13 14 15
     */
    public function find($id);

    /**
16
     * Return a collection of all elements of the resource
17 18 19 20 21
     * @return mixed
     */
    public function all();

    /**
22
     * Create a resource
23 24 25 26 27 28 29
     * @param $data
     * @return mixed
     */
    public function create($data);

    /**
     * Update a resource
30 31
     * @param $model
     * @param array $data
32 33
     * @return mixed
     */
34
    public function update($model, $data);
35 36

    /**
37 38
     * Destroy a resource
     * @param $model
39 40
     * @return mixed
     */
41
    public function destroy($model);
42
}