Ejemplo n.º 1
0
 /**
  * @return bool
  */
 public function validate() : bool
 {
     $errorStorage = $this->getNode()->getZone()->getErrorsStore();
     if (!SoaNotInRootValidator::validate($this)) {
         $errorStorage->add(ValidationError::makeRecordError($this, eErrorCode::SOA_RECORD_NOT_IN_ROOT(), 'name'));
     }
     $attributes = ['serial' => $this->getSerial(), 'refresh' => $this->getRefresh(), 'retry' => $this->getRetry(), 'expire' => $this->getExpire(), 'minimum' => $this->getMinimum()];
     foreach ($attributes as $atr => $value) {
         if (!Int32Validator::validate($value)) {
             $errorStorage->add(ValidationError::makeRecordError($this, eErrorCode::WRONG_INT32(), $atr));
         }
     }
     /** @noinspection PhpInternalEntityUsedInspection */
     return parent::validate();
 }