36 lines
646 B
PHP
36 lines
646 B
PHP
<?php
|
|
|
|
namespace Modules\Admin\Repositories;
|
|
|
|
use Modules\Admin\Models\Gender;
|
|
|
|
|
|
class GenderRepository implements GenderInterface
|
|
{
|
|
public function findAll()
|
|
{
|
|
return Gender::get();
|
|
}
|
|
|
|
public function getGenderById($genderId)
|
|
{
|
|
return Gender::findOrFail($genderId);
|
|
}
|
|
|
|
public function delete($genderId)
|
|
{
|
|
Gender::destroy($genderId);
|
|
}
|
|
|
|
public function create(array $genderDetails)
|
|
{
|
|
return Gender::create($genderDetails);
|
|
}
|
|
|
|
public function update($genderId, array $newDetails)
|
|
{
|
|
return Gender::where('id', $genderId)->update($newDetails);
|
|
}
|
|
|
|
}
|