41 lines
872 B
PHP
41 lines
872 B
PHP
<?php
|
|
|
|
namespace Modules\Estimate\Repositories;
|
|
|
|
use Modules\Estimate\Models\EstimateDetail;
|
|
|
|
class EstimateDetailRepository implements EstimateDetailInterface
|
|
{
|
|
public function findAll()
|
|
{
|
|
return EstimateDetail::all();
|
|
}
|
|
|
|
public function getEstimateDetailById($EstimateDetailId)
|
|
{
|
|
return EstimateDetail::findOrFail($EstimateDetailId);
|
|
}
|
|
|
|
|
|
public function delete($EstimateDetailId)
|
|
{
|
|
EstimateDetail::destroy($EstimateDetailId);
|
|
}
|
|
|
|
public function create($EstimateDetailDetails)
|
|
{
|
|
return EstimateDetail::create($EstimateDetailDetails);
|
|
}
|
|
|
|
public function update($EstimateDetailId, array $newDetails)
|
|
{
|
|
return EstimateDetail::whereId($EstimateDetailId)->update($newDetails);
|
|
}
|
|
|
|
public function pluck()
|
|
{
|
|
return EstimateDetail::pluck('title', 'id');
|
|
}
|
|
|
|
}
|