/** * Generate list of urls for global scope * * @return \Magento\UrlRewrite\Service\V1\Data\UrlRewrite[] */ protected function generateForGlobalScope() { $urls = []; $categoryId = $this->category->getId(); foreach ($this->category->getStoreIds() as $id) { if (!$this->isGlobalScope($id) && !$this->storeViewService->doesEntityHaveOverriddenUrlKeyForStore($id, $categoryId, Category::ENTITY)) { $urls = array_merge($urls, $this->generateForSpecificStoreView($id)); } } return $urls; }
/** * @expectedException \InvalidArgumentException * @expectedExceptionMessage Cannot retrieve attribute for entity type "invalid_type" */ public function testInvalidAttributeRetrieve() { $invalidEntityType = 'invalid_type'; $this->config->expects($this->once())->method('getAttribute')->will($this->returnValue(false)); $this->storeViewService->doesEntityHaveOverriddenUrlKeyForStore(1, 1, $invalidEntityType); }
/** * @param int $storeId * @param int $categoryId * @return bool */ protected function isOverrideUrlsForStore($storeId, $categoryId) { return $this->overrideStoreUrls || !$this->storeViewService->doesEntityHaveOverriddenUrlKeyForStore($storeId, $categoryId, Category::ENTITY); }