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()


24.5k

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