Can somebody tell me whats wrong with my code ? I followed the REST api tutorial and applied what they said but I'm still having the same error " Argument 1 passed to Phalcon\Mvc\Model::validate() must implement interface Phalcon\ValidationInterface, instance of Phalcon\Mvc\Model\Validator\Inclusionin given in" . When I implement the interface it still doesn't work.
public function validation()
{
$this->validate(
new InclusionInValidator (
array(
"field" => 'gender',
"domain" => array(
'M',
'F'
)
)
)
);
$this->validate(
new Uniqueness(
array(
"field" => "user_name",
"message" => "This username is already used, please choose another one"
)
)
);
if ($this->validationHasFailed() == true) {
return false;
}
}
}