helper = $helper; $this->jsonSerializer = $jsonSerializer; } /** * @return string */ protected function _toHtml() { $result = ''; if ($this->isDirectionCanBeHide()) { $result = parent::_toHtml(); } return $result; } /** * @return bool */ private function isDirectionCanBeHide(): bool { $result = false; foreach ($this->getPermanentDirectionAttributes() as $attribute) { if ($result = !$this->helper->isMethodDisabled($attribute)) { break; } } return $result; } /** * @return array */ public function getPermanentDirectionAttributes(): array { return static::PERMANENT_DIRECTION_ATTRIBUTES; } /** * @return string */ public function getPermanentDirectionAttributesJson(): string { return $this->jsonSerializer->serialize($this->getPermanentDirectionAttributes()); } }