<?php

namespace Modules\Way\Services;

use Illuminate\Http\Request;
use Modules\Way\Interfaces\WayRepositoryInterface;
use Modules\Way\Models\Way;

class WayService
{
    private WayRepositoryInterface $wayRepository ;

    public function __construct(WayRepositoryInterface $wayRepository)
    {
        $this->wayRepository = $wayRepository;
    }

    public function get(Request $request)
    {
        $ways = $this->wayRepository->get($request);
        return $ways;
    }
    public function getItem(Way $way)
    {
        $way = $this->wayRepository->getItem($way);
        return $way;
    }
    public function save(Request $request, ?Way $way): Way
    {
        $way = $this->wayRepository->save($request,$way);
        return $way;
    }
    public function destroy(Request $request, int $id): array
    {
        $response = $this->wayRepository->destroy($request,$id);
        return $response;
    }
    public function destroyAll(Request $request): array
    {
        $response = $this->wayRepository->destroyAll($request);
        return $response;
    }
    public function restore(Request $request, int $id): array
    {
        $response = $this->wayRepository->restore($request,$id);
        return $response;
    }
    public function restoreAll(Request $request): array
    {
        $response = $this->wayRepository->restoreAll($request);
        return $response;
    }
}
