cookieRepository = $cookieRepository; $this->searchCriteriaBuilder = $searchCriteriaBuilder; } /** * @inheritDoc */ public function execute(): array { if (null === $this->mapping) { $searchResults = $this->cookieRepository->getList($this->searchCriteriaBuilder->create()); $this->mapping = []; foreach ($searchResults->getItems() as $cookie) { $this->mapping[$cookie->getName()] = $cookie->getCategoryKey(); } } return $this->mapping; } }