<?php

namespace Modules\Option\Services;

use Illuminate\Http\Request;
use Modules\Option\Interfaces\OptionRepositoryInterface;
use Modules\Option\Models\Option;

class OptionService
{
    private OptionRepositoryInterface $optionRepository ;

    public function __construct(OptionRepositoryInterface $optionRepository)
    {
        $this->optionRepository = $optionRepository;
    }

    public function get(Request $request)
    {
        $options= $this->optionRepository->get($request);
        return $options;
    }
    public function getItem(Option $option)
    {
        $option = $this->optionRepository->getItem($option);
        return $option;
    }
    public function save(Request $request, ?Option $option): Option
    {
        $option = $this->optionRepository->save($request,$option);
        return $option;
    }
    public function destroy(Request $request, int $id): array
    {
        $response = $this->optionRepository->destroy($request,$id);
        return $response;
    }
    public function destroyAll(Request $request): array
    {
        $response = $this->optionRepository->destroyAll($request);
        return $response;
    }
    public function restore(Request $request, int $id): array
    {
        $response = $this->optionRepository->restore($request,$id);
        return $response;
    }
    public function restoreAll(Request $request): array
    {
        $response = $this->optionRepository->restoreAll($request);
        return $response;
    }
}
