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

MongoCollection - A dependency injector container is required to obtain the services related to the ODM

I am experiencing a new error using legacy code.

A dependency injector container is required to obtain the services related to the ODM

In a class that extends \Phalcon\Mvc\MongoCollection the application fails on:

$this->save()


47.7k

This code in save() for MongoCollection:

       $dependencyInjector = $this->_dependencyInjector;

        if (!is_object($dependencyInjector)) {
            throw new Exception(
                "A dependency injector container is required to obtain the services related to the ODM"
            );
        }