mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 17:44:41 +00:00
mvc: UnqiueIdField special validation message
If we ever derive from UnqiueIdField we would end up overwriting this message and there is no data validation involved which the message would be for so it can be null as per BaseField.
This commit is contained in:
parent
8d8cc03ac3
commit
2cd5fcac5c
@ -41,11 +41,6 @@ class UniqueIdField extends BaseField
|
||||
*/
|
||||
protected $internalIsContainer = false;
|
||||
|
||||
/**
|
||||
* @var string default validation message string
|
||||
*/
|
||||
protected $internalValidationMessage = "Unique ID is immutable";
|
||||
|
||||
/**
|
||||
* @var null|string initial field value
|
||||
*/
|
||||
@ -67,8 +62,10 @@ class UniqueIdField extends BaseField
|
||||
}
|
||||
$validators = parent::getValidators();
|
||||
// unique id may not change..
|
||||
$validators[] = new InclusionIn(array('message' => $this->internalValidationMessage,
|
||||
'domain' => array($this->initialValue)));
|
||||
$validators[] = new InclusionIn([
|
||||
'message' => gettext('Unique ID is immutable.'),
|
||||
'domain' => [$this->initialValue],
|
||||
]);
|
||||
return $validators;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user