0

I'm trying to setup MongoDB collection for my PhalconPHP application.

I have the mongo and collectionManager set up.

$di->set('collectionManager', function(){
    return new Phalcon\Mvc\Collection\Manager();
}, true);

//MongoDB Database
$di->set('mongo', function() {
    $mongo = new MongoClient("localhost:27017");
    return $mongo->selectDb("test");
}, true);

I have a model

class User extends \Phalcon\Mvc\Collection {
....
}

Then I got this error

Unexpected value type: expected object implementing Phalcon\Mvc\ModelInterface, object of type MyApp\Models\User given

gunr2171
  • 16,104
  • 25
  • 61
  • 88
VladoM
  • 64
  • 3

1 Answers1

0

Disclaimer: This was extracted from the question.

I was using Model validation instead Validation in the model body.

gunr2171
  • 16,104
  • 25
  • 61
  • 88