public function validate(\Nethgui\Controller\ValidationReportInterface $report) { parent::validate($report); if ($this->getRequest()->isMutation()) { $v = $this->createValidator()->platform('interface-config'); if (!$v->evaluate(json_encode($this->parameters->getArrayCopy()))) { $report->addValidationError($this, 'interface-config', $v); } } }
public function validate(\Nethgui\Controller\ValidationReportInterface $report) { // Bind the dhcp-reservation platform validator: $this->getValidator('IpAddress')->platform('dhcp-reservation', $this->parameters['MacAddress'], $this->parameters['hostname']); parent::validate($report); }
public function validate(\Nethgui\Controller\ValidationReportInterface $report) { parent::validate($report); if ($this->getRequest()->isMutation()) { $v = $this->createValidator()->platform('interface-config'); if (!$v->evaluate(json_encode($this->parameters->getArrayCopy()))) { $report->addValidationError($this, 'interface-config', $v); } $providers = $this->getPlatform()->getDatabase('networks')->getAll(); $request = $this->getRequest(); $device = \Nethgui\array_head($request->getPath()); if (!empty($providers[$this->parameters['ProviderName']]) && $providers[$this->parameters['ProviderName']]['interface'] != $device) { $report->addValidationError($this, 'interface-config', $v); } } }