You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publicfunction validation()
{
$validator = newValidation();
$validator->add(
'email',
newUniqueness([
'model' => $this,
'message' => "The email must be unique.",
'code' => 20
])
);
$this->validate($validator);
Uniquess validator properly sets the code but model.zep below ignores it.
protectedfunctionvalidate(<ValidationInterface> validator) ->boolean
{
var messages, message;
let messages = validator->validate(null, this);
// Call the validation, if it returns not the boolean// we append the messages to the current objectiftypeof messages =="boolean" {
return messages;
}
for message in iterator(messages) {
this->appendMessage(
newMessage(
message->getMessage(),
message->getField(),
message->getType()
)
);
}
// If there is a message, it returns false otherwise truereturn!count(messages);
}
The text was updated successfully, but these errors were encountered:
Model validation
Uniquess validator properly sets the code but model.zep below ignores it.
The text was updated successfully, but these errors were encountered: