configValidator = $configValidator; parent::__construct($context, $registry, $config, $cacheTypeList, $resource, $resourceCollection, $data); } /** * Validate a domain name value * * @return $this * @throws \Magento\Framework\Exception\LocalizedException */ public function beforeSave() { $value = $this->getValue(); if (!empty($value) && !$this->configValidator->isValid($value)) { $msg = __('Invalid cookie lifetime: %1', join('; ', $this->configValidator->getMessages())); throw new \Magento\Framework\Exception\LocalizedException($msg); } return parent::beforeSave(); } }