Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Uniqueness - Fields in failed message

Hi,

I'm using Phalcon\Validation\Validator\Uniqueness and I have the following rule for categories and accounts:

$validation->add(['name', 'accountId'], new Uniqueness([
    'label' => 'category'
]));

I would like to know if it is possible to change the field returned by the Phalcon\Validation\Message object to "name", because "accountId" is controlled internally by the application.



135.6k
Accepted
answer

Actually not sure if this is possible and also i had this issue sometimes also that returned field name is kinf of bad, can you open NFR at github?

I think it is not a problem, but an atypical case. My business rule works differently. Sure I can. Thanks for the answer.

Actually not sure if this is possible and also i had this issue sometimes also that returned field name is kinf of bad, can you open NFR at github?