<?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::whereId($promotionDemotionId)->update($newDetails);
    }

}