mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 06:56:05 +00:00
type fix
This commit is contained in:
@@ -138,11 +138,12 @@ class FieldValidationManager
|
||||
*/
|
||||
private function getMandatoryValidationList(string $entityType, string $field): array
|
||||
{
|
||||
/** @var ?string $fieldType */
|
||||
$fieldType = $this->fieldUtil->getEntityTypeFieldParam($entityType, $field, 'type');
|
||||
|
||||
return
|
||||
$this->metadata->get(['entityDefs', $entityType, 'fields', $field, 'mandatoryValidationList']) ??
|
||||
$this->metadata->get(['fields', $fieldType, 'mandatoryValidationList']) ?? [];
|
||||
$this->metadata->get(['fields', $fieldType ?? '', 'mandatoryValidationList']) ?? [];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -150,11 +151,12 @@ class FieldValidationManager
|
||||
*/
|
||||
private function getValidationList(string $entityType, string $field): array
|
||||
{
|
||||
/** @var ?string $fieldType */
|
||||
$fieldType = $this->fieldUtil->getEntityTypeFieldParam($entityType, $field, 'type');
|
||||
|
||||
return
|
||||
$this->metadata->get(['entityDefs', $entityType, 'fields', $field, 'validationList']) ??
|
||||
$this->metadata->get(['fields', $fieldType, 'validationList']) ?? [];
|
||||
$this->metadata->get(['fields', $fieldType ?? '', 'validationList']) ?? [];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -69,11 +69,12 @@ class ValidatorFactory
|
||||
*/
|
||||
private function getClassName(string $entityType, string $field, string $type): ?string
|
||||
{
|
||||
/** @var ?string $fieldType */
|
||||
$fieldType = $this->fieldUtil->getEntityTypeFieldParam($entityType, $field, 'type');
|
||||
|
||||
return
|
||||
$this->metadata->get(['entityDefs', $entityType, 'fields', $field, 'validatorClassNameMap', $type]) ??
|
||||
$this->metadata->get(['fields', $fieldType, 'validatorClassNameMap', $type]);
|
||||
$this->metadata->get(['fields', $fieldType ?? '', 'validatorClassNameMap', $type]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user