Hi guys,
I am using the below function to validate the uniqueness of 2 form fields in my model. This used to work just fine, but at some point (after 2-3 phalcon upgrades) something changed and it's not working anymore.
public function validation()
{
$this->validate(
new Uniqueness(
array(
"fields" => array("email", "vat_no"),
"message" => "This email of VAT number is already registered"
)
)
);
return $this->validationHasFailed() != true;
}
And the message I am getting is
Catchable fatal error: Argument 1 passed to Phalcon\Mvc\Model::validate() must implement interface Phalcon\ValidationInterface, instance of Phalcon\Mvc\Model\Validator\Uniqueness given
As per the docs, I assume I am doing everything correctly... Can anyone shed some light on this?
Thanks!