40 lines
767 B
PHP
40 lines
767 B
PHP
<?php
|
|
|
|
namespace Modules\Recruit\Repositories;
|
|
|
|
use Modules\Recruit\Models\JobPost;
|
|
|
|
|
|
class JobPostRepository implements JobPostInterface
|
|
{
|
|
public function findAll()
|
|
{
|
|
return JobPost::get();
|
|
}
|
|
|
|
public function getJobPostById($jobPostId)
|
|
{
|
|
return JobPost::findOrFail($jobPostId);
|
|
}
|
|
|
|
public function delete($jobPostId)
|
|
{
|
|
JobPost::destroy($jobPostId);
|
|
}
|
|
|
|
public function create(array $jobPostDetails)
|
|
{
|
|
return JobPost::create($jobPostDetails);
|
|
}
|
|
|
|
public function update($jobPostId, array $newDetails)
|
|
{
|
|
return JobPost::where('job_post_id', $jobPostId)->update($newDetails);
|
|
}
|
|
|
|
public function pluck(){
|
|
return JobPost::pluck('title', 'job_post_id');
|
|
}
|
|
|
|
}
|