41 lines
852 B
PHP
41 lines
852 B
PHP
|
<?php
|
||
|
|
||
|
namespace Modules\Recruit\Repositories;
|
||
|
|
||
|
use Modules\Recruit\Models\OfferLetter;
|
||
|
|
||
|
|
||
|
class OfferLetterRepository implements OfferLetterInterface
|
||
|
{
|
||
|
public function findAll()
|
||
|
{
|
||
|
return OfferLetter::get();
|
||
|
}
|
||
|
|
||
|
public function getOfferLetterById($offerLetterId)
|
||
|
{
|
||
|
return OfferLetter::findOrFail($offerLetterId);
|
||
|
}
|
||
|
|
||
|
public function delete($offerLetterId)
|
||
|
{
|
||
|
OfferLetter::destroy($offerLetterId);
|
||
|
}
|
||
|
|
||
|
public function create(array $offerLetterDetails)
|
||
|
{
|
||
|
return OfferLetter::create($offerLetterDetails);
|
||
|
}
|
||
|
|
||
|
public function update($offerLetterId, array $newDetails)
|
||
|
{
|
||
|
return OfferLetter::where('offer_letter_id', $offerLetterId)->update($newDetails);
|
||
|
}
|
||
|
|
||
|
public function pluck()
|
||
|
{
|
||
|
return OfferLetter::pluck('title', 'offer_letter_id');
|
||
|
}
|
||
|
|
||
|
}
|