36 lines
735 B
PHP
36 lines
735 B
PHP
|
<?php
|
||
|
|
||
|
namespace Modules\Attendance\Repositories;
|
||
|
|
||
|
use Modules\Attendance\Models\Attendance;
|
||
|
|
||
|
|
||
|
class AttendanceRepository implements AttendanceInterface
|
||
|
{
|
||
|
public function findAll()
|
||
|
{
|
||
|
return Attendance::get();
|
||
|
}
|
||
|
|
||
|
public function getAttendanceById($attendanceId)
|
||
|
{
|
||
|
return Attendance::findOrFail($attendanceId);
|
||
|
}
|
||
|
|
||
|
public function delete($attendanceId)
|
||
|
{
|
||
|
Attendance::destroy($attendanceId);
|
||
|
}
|
||
|
|
||
|
public function create(array $attendanceDetails)
|
||
|
{
|
||
|
return Attendance::create($attendanceDetails);
|
||
|
}
|
||
|
|
||
|
public function update($attendanceId, array $newDetails)
|
||
|
{
|
||
|
return Attendance::where('attendance_id', $attendanceId)->update($newDetails);
|
||
|
}
|
||
|
|
||
|
}
|