40 lines
749 B
PHP
40 lines
749 B
PHP
|
<?php
|
||
|
|
||
|
namespace Modules\PMS\Repositories;
|
||
|
|
||
|
use Modules\PMS\Models\Project;
|
||
|
|
||
|
class ProjectRepository implements ProjectInterface
|
||
|
{
|
||
|
public function findAll()
|
||
|
{
|
||
|
return Project::paginate(20);
|
||
|
}
|
||
|
|
||
|
public function getProjectById($ProjectId)
|
||
|
{
|
||
|
return Project::findOrFail($ProjectId);
|
||
|
}
|
||
|
|
||
|
public function delete($ProjectId)
|
||
|
{
|
||
|
Project::destroy($ProjectId);
|
||
|
}
|
||
|
|
||
|
public function create($ProjectDetails)
|
||
|
{
|
||
|
return Project::create($ProjectDetails);
|
||
|
}
|
||
|
|
||
|
public function update($ProjectId, array $newDetails)
|
||
|
{
|
||
|
return Project::whereId($ProjectId)->update($newDetails);
|
||
|
}
|
||
|
|
||
|
public function pluck()
|
||
|
{
|
||
|
return Project::pluck('project_name', 'id');
|
||
|
}
|
||
|
|
||
|
}
|