Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
WebsiteNameResolver.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
12 
19 {
23  private $websiteRepository;
24 
28  public function __construct(
29  WebsiteRepositoryInterface $websiteRepository
30  ) {
31  $this->websiteRepository = $websiteRepository;
32  }
33 
37  public function resolve(string $type, string $code): string
38  {
39  return SalesChannelInterface::TYPE_WEBSITE === $type ? $this->websiteRepository->get($code)->getName() : $code;
40  }
41 }
$type
Definition: item.phtml:13
__construct(WebsiteRepositoryInterface $websiteRepository)
$code
Definition: info.phtml:12