Hi. If I got it righ, Phalcon\Mvc\Model\Validator will be deprecated in 2.1.0 and currently both old and new(Phalcon\Validation\Validator) can be used for model validation. Seem that prior to 2.0.8 it was possible to add multiple fields to validation that way:
$this -> validate(new Phalcon\Mvc\Model\Validator\Numericality([
'field' => ['invoice_id','part_index','price','qty','discount','points'],
'message' => 'This field should be numeric'
]));
How to achieve the same with new Phalcon\Validation\Validator?
Also currently I'm using 2.0.10 and I'm unable to pass array of fields neither to Phalcon\Mvc\Model\Validator\ (using 'field' or 'fields') nor to new $validator->add()
method as first field
parameter.
I got Phalcon exception for new method and old method with array assigned to field
, or validation failure for correct values in case array assigned to fields
.