urlBuilder = $context->getUrlBuilder(); $this->registry = $registry; } /** * Return the current Catalog Rule Id. * * @return int|null */ public function getRuleId() { $catalogRule = $this->registry->registry(RegistryConstants::CURRENT_CATALOG_RULE_ID); return $catalogRule ? $catalogRule->getId() : null; } /** * Generate url by route and parameters * * @param string $route * @param array $params * @return string */ public function getUrl($route = '', $params = []) { return $this->urlBuilder->getUrl($route, $params); } /** * Check where button can be rendered * * @param string $name * @return string */ public function canRender($name) { return $name; } }