urlBuilder = $context->getUrlBuilder(); $this->registry = $registry; } /** * Return the current sales Rule Id. * * @return int|null */ public function getRuleId() { $salesRule = $this->registry->registry(RegistryConstants::CURRENT_SALES_RULE); return $salesRule ? $salesRule->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; } }