36 lines
671 B
PHP
36 lines
671 B
PHP
|
<?php
|
||
|
|
||
|
namespace Modules\Admin\Repositories;
|
||
|
|
||
|
use Modules\Admin\Models\Warning;
|
||
|
|
||
|
|
||
|
class WarningRepository implements WarningInterface
|
||
|
{
|
||
|
public function findAll()
|
||
|
{
|
||
|
return Warning::get();
|
||
|
}
|
||
|
|
||
|
public function getWarningById($warningId)
|
||
|
{
|
||
|
return Warning::findOrFail($warningId);
|
||
|
}
|
||
|
|
||
|
public function delete($warningId)
|
||
|
{
|
||
|
Warning::destroy($warningId);
|
||
|
}
|
||
|
|
||
|
public function create(array $warningDetails)
|
||
|
{
|
||
|
return Warning::create($warningDetails);
|
||
|
}
|
||
|
|
||
|
public function update($warningId, array $newDetails)
|
||
|
{
|
||
|
return Warning::where('warning_id', $warningId)->update($newDetails);
|
||
|
}
|
||
|
|
||
|
}
|