I have upgraded to Phalcon 3.0.0:
- Build Date Aug 9 2016 18:43:20
- Powered by Zephir Version 0.9.3a-dev-e716dbe641
I am now experiencing the following problem in some of my models validators:
Catchable fatal error: Argument 1 passed to Phalcon\Mvc\Model::validate() must implement interface Phalcon\ValidationInterface, instance of Phalcon\Mvc\Model\Validator\Uniqueness given
In my Model I have:
public function validation()
{
$this->validate(new \Phalcon\Mvc\Model\Validator\Uniqueness(
[
'field' => 'name',
'message' => 'This display name is already in use. Please try another one.'
]
));
$this->validate(new \Phalcon\Mvc\Model\Validator\PresenceOf(
[
"field" => "name",
"message" => "You must enter the group name to save it."
]
));
return $this->validationHasFailed() != true;
}
Either this is now wrong and the documentation is incorrect or there is a bug in Phalcon.
Can anyone advise me on this matter? Why is phalcon demanding Phalcon\ValidationInterface and not Phalcon\Mvc\Model\ValidatorInterface?