Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

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;
    }


35.1k

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



35.1k

Thank you. It is working.