first commit
This commit is contained in:
34
Modules/Training/app/Repositories/TrainingListRepository.php
Normal file
34
Modules/Training/app/Repositories/TrainingListRepository.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?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);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user