phalcon/cphalcon · error · Phalcon\Mvc\Model\MetaData\Exceptions\NoPropertyAnnotationsForClass

No properties with annotations were found in class

Error message

No properties with annotations were found in class {className}

What it means

Thrown by the Annotations metadata strategy when the class's reflection has no annotated properties at all — the strategy derives metadata (columns, primary key, identities) from @Column/@Primary etc. property annotations, and with none present it cannot build the metadata.

Solutions

  1. Add the required ORM property annotations (@Column, @Primary, @Identity) to the model class
  2. Switch the model's metadata strategy to introspection (Strategy\Introspection) if the schema should be read from the database instead
  3. Verify the annotations adapter is configured in the DI container and the file is readable
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at phalcon/Mvc/Model/MetaData/Strategy/Annotations.zep:52 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/edcce1a5cc868b83. Report an issue: GitHub.

Appendix: source

Thrown at phalcon/Mvc/Model/MetaData/Strategy/Annotations.zep:52

            throw new InvalidContainer();
        }

        let annotations = container->get("annotations");

        let className = get_class(model),
            reflection = annotations->get(className);

        if unlikely typeof reflection != "object" {
            throw new NoAnnotationsForClass(className);
        }

        /**
         * Get the properties defined in
         */
        let propertiesAnnotations = reflection->getPropertiesAnnotations();

        if unlikely empty propertiesAnnotations {
            throw new NoPropertyAnnotationsForClass(className);
        }

        let orderedColumnMap = [],
            reversedColumnMap = [],
            hasReversedColumn = false;

        for property, propAnnotations in propertiesAnnotations {
            /**
             * All columns marked with the 'Column' annotation are considered columns
             */
            if !propAnnotations->has("Column") {
                continue;
            }

            /**
             * Fetch the 'column' annotation
             */
            let columnAnnotation = propAnnotations->get("Column");

View on GitHub (pinned to b7419de9cd)