{"record":{"id":"1a1a44835d4d5cf2","repo":"phalcon/cphalcon","slug":"a-dependency-injection-container-is-required-to-ac-1a1a44","errorCode":null,"errorMessage":"A dependency injection container is required to access the services related to the ODM in '{className}'","messagePattern":"A dependency injection container is required to access the services related to the ODM in '(.+?)'","errorType":"exception","errorClass":"Phalcon\\Mvc\\Model\\Exceptions\\ModelOrmServicesUnavailable","httpStatus":null,"severity":"error","filePath":"phalcon/Mvc/Model.zep","lineNumber":279,"sourceCode":"    private static privatePropertiesCache = [];\n\n    /**\n     * Phalcon\\Mvc\\Model constructor\n     */\n    final public function __construct(\n        var data = null,\n        <DiInterface> container = null,\n        <ManagerInterface> modelsManager = null\n    ) {\n        /**\n         * We use a default DI if the user does not define one\n         */\n        if container === null {\n            let container = Di::getDefault();\n        }\n\n        if container === null {\n            throw new ModelOrmServicesUnavailable(get_class(this));\n        }\n\n        let this->container = container;\n\n        /**\n         * Inject the manager service from the DI\n         */\n        if modelsManager === null {\n            let modelsManager = <ManagerInterface> container->getShared(\"modelsManager\");\n            if modelsManager === null {\n                throw new InvalidModelsManagerService(get_class(this));\n            }\n        }\n\n        /**\n         * Update the models-manager\n         */\n        let this->modelsManager = modelsManager;","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Mvc/Model.zep#L261-L297","documentation":"Error \"A dependency injection container is required to access the services related to the ODM in '{className}'\" thrown in phalcon/cphalcon.","triggerScenarios":"Thrown at phalcon/Mvc/Model.zep:279 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b7419de9cd0a8a3f48441ead84c9f8415d463e25","analyzedAt":"2026-08-21T06:21:18.811Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}