36 lines
852 B
PHP
36 lines
852 B
PHP
|
<?php
|
||
|
|
||
|
namespace Modules\Admin\Repositories;
|
||
|
|
||
|
use Modules\Admin\Models\PromotionDemotion;
|
||
|
|
||
|
|
||
|
class PromotionDemotionRepository implements PromotionDemotionInterface
|
||
|
{
|
||
|
public function findAll()
|
||
|
{
|
||
|
return PromotionDemotion::get();
|
||
|
}
|
||
|
|
||
|
public function getPromotionDemotionById($promotionDemotionId)
|
||
|
{
|
||
|
return PromotionDemotion::findOrFail($promotionDemotionId);
|
||
|
}
|
||
|
|
||
|
public function delete($promotionDemotionId)
|
||
|
{
|
||
|
PromotionDemotion::destroy($promotionDemotionId);
|
||
|
}
|
||
|
|
||
|
public function create(array $promotionDemotionDetails)
|
||
|
{
|
||
|
return PromotionDemotion::create($promotionDemotionDetails);
|
||
|
}
|
||
|
|
||
|
public function update($promotionDemotionId, array $newDetails)
|
||
|
{
|
||
|
return PromotionDemotion::where('promotion_demotion_id', $promotionDemotionId)->update($newDetails);
|
||
|
}
|
||
|
|
||
|
}
|