Commit 91743084 authored by Abdel Nalbou's avatar Abdel Nalbou

added PHPdoc

parent 8402aaaf
<?php namespace Modules\Core\Repositories; <?php namespace Modules\Core\Repositories;
/**
* Interface CoreRepository
* @package Modules\Core\Repositories
*/
interface CoreRepository interface CoreRepository
{ {
/**
* @param $id
* @return mixed
*/
public function find($id); public function find($id);
/**
* @return mixed
*/
public function all(); public function all();
/**
* @param $data
* @return mixed
*/
public function add($data); public function add($data);
/**
* @param $ids
* @return mixed
*/
public function remove($ids); public function remove($ids);
} }
...@@ -3,30 +3,55 @@ ...@@ -3,30 +3,55 @@
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Modules\Core\Repositories\CoreRepository; use Modules\Core\Repositories\CoreRepository;
/**
* Class EloquentCoreRepository
* @package Modules\Core\Repositories\Eloquent
*/
abstract class EloquentCoreRepository implements CoreRepository abstract class EloquentCoreRepository implements CoreRepository
{ {
/**
* @var Model An instance of the Eloquent Model
*/
protected $model; protected $model;
/**
* @param Model $model
*/
public function __construct(Model $model) public function __construct(Model $model)
{ {
$this->model = $model; $this->model = $model;
} }
/**
* @param int $id
* @return mixed
*/
public function find($id) public function find($id)
{ {
return $this->model->find($id); return $this->model->find($id);
} }
/**
* @return mixed
*/
public function all() public function all()
{ {
return $this->model->all(); return $this->model->all();
} }
/**
* @param mixed $data
* @return mixed
*/
public function add($data) public function add($data)
{ {
return $this->model->create($data); return $this->model->create($data);
} }
/**
* @param int|int[] $ids
* @return mixed
*/
public function remove($ids) public function remove($ids)
{ {
return $this->model->destroy($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