<?php

namespace Modules\Slider\Services;

use Illuminate\Http\Request;
use Modules\Slider\Models\Slider;
use Modules\Slider\Interfaces\SliderRepositoryInterface;

class SliderService
{
    private SliderRepositoryInterface $sliderRepository ;

    public function __construct(SliderRepositoryInterface $sliderRepository)
    {
        $this->sliderRepository = $sliderRepository;
    }

    public function get(Request $request)
    {
        $sliders= $this->sliderRepository->get($request);
        return $sliders;
    }
    public function getItem(Slider $slider)
    {
        $slider = $this->sliderRepository->getItem($slider);
        return $slider;
    }
    public function save(Request $request, ?Slider $slider): Slider
    {
        $slider = $this->sliderRepository->save($request,$slider);
        return $slider;
    }
    public function destroy(Request $request, int $id): array
    {
        $response = $this->sliderRepository->destroy($request,$id);
        return $response;
    }
    public function destroyAll(Request $request): array
    {
        $response = $this->sliderRepository->destroyAll($request);
        return $response;
    }
    public function restore(Request $request, int $id): array
    {
        $response = $this->sliderRepository->restore($request,$id);
        return $response;
    }
    public function restoreAll(Request $request): array
    {
        $response = $this->sliderRepository->restoreAll($request);
        return $response;
    }
}
