0

I'm having issues to use a ConsoleController and make queries to the database using Doctrine ODM.

The controller works fine, displays the banner and reacts to the different commands and variables passed to it.

Also, through the browser, the app works fine, making proper queries to the database.

But when on the ConsoleController I get to this line:

$settings = $dm->createQueryBuilder('CPQ\Model\Settings')
  ->getQuery()->getSingleResult();

I get the following error thrown on the command line:

PHP Fatal error:  Class 'Mongo' not found in /path/to/app/vendor/doctrine/mongodb/lib/Doctrine/MongoDB/Connection.php on line 99

Is there any special bootstrapping or path configuration that should be done? The specific line on that file is trying to do the following:

return new \Mongo($server ?: 'mongodb://localhost:27017', $options);

Thanks! Martín.

0 Answers0