39 lines
780 B
PHP
39 lines
780 B
PHP
<?php
|
|
|
|
namespace Modules\Office\Repositories;
|
|
|
|
use Modules\Office\Models\Generator;
|
|
|
|
|
|
class GeneratorRepository implements GeneratorInterface
|
|
{
|
|
public function pluck(){
|
|
return Generator::pluck('name','id');
|
|
}
|
|
public function findAll()
|
|
{
|
|
return Generator::get();
|
|
}
|
|
|
|
public function getGeneratorById($generatorId)
|
|
{
|
|
return Generator::findOrFail($generatorId);
|
|
}
|
|
|
|
public function delete($generatorId)
|
|
{
|
|
Generator::destroy($generatorId);
|
|
}
|
|
|
|
public function create(array $generatorDetails)
|
|
{
|
|
return Generator::create($generatorDetails);
|
|
}
|
|
|
|
public function update($generatorId, array $newDetails)
|
|
{
|
|
return Generator::where('id', $generatorId)->update($newDetails);
|
|
}
|
|
|
|
}
|