dbmsv4 init...5
This commit is contained in:
parent
9775453442
commit
5fc19000ed
@ -380,7 +380,6 @@ abstract class CommonForm
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->_validation->setRules($dynamicRules);
|
$this->_validation->setRules($dynamicRules);
|
||||||
|
|
||||||
if (!$this->_validation->run($formDatas)) {
|
if (!$this->_validation->run($formDatas)) {
|
||||||
$errors = $this->_validation->getErrors();
|
$errors = $this->_validation->getErrors();
|
||||||
throw new RuntimeException(implode("\n", $errors));
|
throw new RuntimeException(implode("\n", $errors));
|
||||||
|
|||||||
@ -71,6 +71,10 @@ class ServerForm extends EquipmentForm
|
|||||||
public function getFormRule(string $field, array $formRules): array
|
public function getFormRule(string $field, array $formRules): array
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
|
case 'clientinfo_uid':
|
||||||
|
case 'serviceinfo_uid':
|
||||||
|
$formRules[$field] = "required|numeric";
|
||||||
|
break;
|
||||||
case "switchinfo_uid":
|
case "switchinfo_uid":
|
||||||
$formRules[$field] = sprintf("permit_empty|numeric%s", in_array($this->formAction, ["create", "create_form"]) ? "|is_unique[{$this->getAttribute('table')}.{$field}]" : "");
|
$formRules[$field] = sprintf("permit_empty|numeric%s", in_array($this->formAction, ["create", "create_form"]) ? "|is_unique[{$this->getAttribute('table')}.{$field}]" : "");
|
||||||
break;
|
break;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user