phalcon/cphalcon · error · Phalcon\Mvc\Model\Exceptions\InvalidContainer

The dependency injector is invalid

Error message

The dependency injector is invalid

What it means

Error "The dependency injector is invalid" thrown in phalcon/cphalcon.

Source

Thrown at phalcon/Mvc/Model/Resultset/Complex.zep:353

         * Store the generated row in this_ptr->activeRow to be retrieved by 'current'
         */
        let this->activeRow = activeRow;

        return activeRow;
    }

    /**
     * Serializing a resultset will dump all related rows into a big array,
     * serialize it and return the resulting string
     */
    public function serialize() -> string
    {
        var container, serializer;
        array data;

        let container = Di::getDefault();
        if container === null {
            throw new InvalidContainer();
        }

        let data = [
            "cache"       : this->cache,
            "rows"        : this->toArray(),
            "columnTypes" : this->columnTypes,
            "hydrateMode" : this->hydrateMode
        ];

        if container->has("serializer") {
            let serializer = <SerializerInterface> container->getShared("serializer");
            serializer->setData(data);

            return serializer->serialize();
        }

        return serialize(data);
    }

View on GitHub (pinned to b7419de9cd)

When it happens

Trigger: Thrown at phalcon/Mvc/Model/Resultset/Complex.zep:353 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of phalcon/cphalcon@b7419de9cd (2026-08-21). Data as JSON: /api/errors/098d5536760647ea. Report an issue: GitHub.