30 private $storeManager;
40 private $storeRepository;
57 $this->service = $service;
59 $this->version = $version;
68 private function getServiceUrl()
70 $store = $this->storeRepository->getById($this->storeManager->getStore()->getId());
71 return $this->url->getUrl(
72 $this->service .
"/" .
$store->getCode() .
"/" . $this->version
85 if (!isset(
$data[
'path']) || empty(
$data[
'path'])) {
86 throw new \InvalidArgumentException(
'URL path is missing.');
89 if (isset(
$data[
'service'])) {
90 $this->service =
"rest";
93 if (isset(
$data[
"version"])) {
94 $this->version =
$data[
"version"];
97 return $this->getServiceUrl() . ltrim(
$data[
"path"],
"/");
__construct(\Magento\Framework\Url $url, StoreManagerInterface $storeManager, StoreRepository $storeRepository, $service="rest", $version="V1")