StocksNew/Modules/Training/app/Repositories/TrainingListRepository.php

35 lines
766 B
PHP
Raw Normal View History

2024-08-27 12:03:06 +00:00
<?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);
}
}