36 lines
697 B
PHP
36 lines
697 B
PHP
<?php
|
|
|
|
namespace Modules\Admin\Repositories;
|
|
|
|
use Modules\Admin\Models\Ethnicity;
|
|
|
|
|
|
class EthnicityRepository implements EthnicityInterface
|
|
{
|
|
public function findAll()
|
|
{
|
|
return Ethnicity::get();
|
|
}
|
|
|
|
public function getEthnicityById($ethnicityId)
|
|
{
|
|
return Ethnicity::findOrFail($ethnicityId);
|
|
}
|
|
|
|
public function delete($ethnicityId)
|
|
{
|
|
Ethnicity::destroy($ethnicityId);
|
|
}
|
|
|
|
public function create(array $ethnicityDetails)
|
|
{
|
|
return Ethnicity::create($ethnicityDetails);
|
|
}
|
|
|
|
public function update($ethnicityId, array $newDetails)
|
|
{
|
|
return Ethnicity::where('id', $ethnicityId)->update($newDetails);
|
|
}
|
|
|
|
}
|