/** * @internal * @return bool */ public function validate() : bool { $errorStorage = $this->getNode()->getZone()->getErrorsStore(); if (!Int16Validator::validate($this->getPreference())) { $errorStorage->add(ValidationError::makeRecordError($this, eErrorCode::WRONG_INT16(), 'preference')); } if (!DnsZoneDomainNameValidator::validate($this->getExchange())) { $errorStorage->add(ValidationError::makeRecordError($this, eErrorCode::WRONG_DOMAIN_NAME(), 'exchange')); } /** @noinspection PhpInternalEntityUsedInspection */ return parent::validate(); }
/** * @return bool */ public function validate() : bool { $errorStorage = $this->getNode()->getZone()->getErrorsStore(); if (!DnsZoneDomainNameValidator::validate($this->getTarget())) { $errorStorage->add(ValidationError::makeRecordError($this, eErrorCode::WRONG_DOMAIN_NAME(), 'name')); } $attributes = ['priority' => $this->getPriority(), 'weight' => $this->getWeight(), 'port' => $this->getPort()]; foreach ($attributes as $atr => $value) { if (!Int16Validator::validate($value)) { $errorStorage->add(ValidationError::makeRecordError($this, eErrorCode::WRONG_INT16(), $atr)); } } /** @noinspection PhpInternalEntityUsedInspection */ return parent::validate(); }