35 lines
766 B
PHP
35 lines
766 B
PHP
|
<?php
|
||
|
|
||
|
namespace Modules\Training\Repositories;
|
||
|
|
||
|
use Modules\Training\Models\TrainingList;
|
||
|
|
||
|
class TrainingListRepository implements TrainingListInterface
|
||
|
{
|
||
|
public function findAll()
|
||
|
{
|
||
|
return TrainingList::get();
|
||
|
}
|
||
|
|
||
|
public function getTrainingListById($trainingListId)
|
||
|
{
|
||
|
return TrainingList::findOrFail($trainingListId);
|
||
|
}
|
||
|
|
||
|
public function delete($trainingListId)
|
||
|
{
|
||
|
TrainingList::destroy($trainingListId);
|
||
|
}
|
||
|
|
||
|
public function create(array $trainingListDetails)
|
||
|
{
|
||
|
return TrainingList::create($trainingListDetails);
|
||
|
}
|
||
|
|
||
|
public function update($trainingListId, array $newDetails)
|
||
|
{
|
||
|
return TrainingList::where('trainingList_id', $trainingListId)->update($newDetails);
|
||
|
}
|
||
|
|
||
|
}
|