Hello
I have AddForm (it is to add new admin model) with such field:
$username = new Text('username');
$username->setLabel('Username');
$username->setFilters(['striptags', 'string']);
$username->addValidator(
new Uniqueness([
'table' => 'admin',
'column' => 'username',
'message' => 'Is is rserved yet.',
'except'
])
);
I use Uniqueness validator to check if there is such username in database. Next I have EditForm (it is to edit existing admin model) and there is also this same username field. And i got problem, because this validator activates during update admin model. I need solution to check Uniqueness of username except of updating model.
I know I can do this in controller with one sql query, but I prefer to do this in form class. Is it possible?
Phalcon 2.1 beta