We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

ODM validation Uniqqueness

has anyone experienced something like

Unexpected value type: expected object implementing Phalcon\Mvc\ModelInterface, object of type App\Core\Models\Mongo\Category\CategoryTranslation given

This is what i have:

    class CategoryTranslation extends \App\Core\Models\Mongo\BaseCollection

    ....

    public function validation()
    {
         $this->validate(new Uniqueness(array(
             'field' => 'slug',
             "message" => "The slug must be unique"
         )));

         return $this->validationHasFailed() != true;
    }


51.2k

Ps: I have checked the https://stackoverflow.com/questions/13873094/phalcon-odm-validation-messages and i still get the same error with the custom validator.



51.2k

Thank you. It is working.