Commit 91743084 authored by Abdel Nalbou's avatar Abdel Nalbou

added PHPdoc

parent 8402aaaf
<?php namespace Modules\Core\Repositories;
/**
* Interface CoreRepository
* @package Modules\Core\Repositories
*/
interface CoreRepository
{
/**
* @param $id
* @return mixed
*/
public function find($id);
/**
* @return mixed
*/
public function all();
/**
* @param $data
* @return mixed
*/
public function add($data);
/**
* @param $ids
* @return mixed
*/
public function remove($ids);
}
......@@ -3,30 +3,55 @@
use Illuminate\Database\Eloquent\Model;
use Modules\Core\Repositories\CoreRepository;
/**
* Class EloquentCoreRepository
* @package Modules\Core\Repositories\Eloquent
*/
abstract class EloquentCoreRepository implements CoreRepository
{
/**
* @var Model An instance of the Eloquent Model
*/
protected $model;
/**
* @param Model $model
*/
public function __construct(Model $model)
{
$this->model = $model;
}
/**
* @param int $id
* @return mixed
*/
public function find($id)
{
return $this->model->find($id);
}
/**
* @return mixed
*/
public function all()
{
return $this->model->all();
}
/**
* @param mixed $data
* @return mixed
*/
public function add($data)
{
return $this->model->create($data);
}
/**
* @param int|int[] $ids
* @return mixed
*/
public function remove($ids)
{
return $this->model->destroy($ids);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment