first commit
This commit is contained in:
39
Modules/Recruit/app/Repositories/JobPostRepository.php
Normal file
39
Modules/Recruit/app/Repositories/JobPostRepository.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?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');
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user