{"record":{"id":"edcce1a5cc868b83","repo":"phalcon/cphalcon","slug":"no-properties-with-annotations-were-found-in-class","errorCode":null,"errorMessage":"No properties with annotations were found in class {className}","messagePattern":"No properties with annotations were found in class (.+?)","errorType":"exception","errorClass":"Phalcon\\Mvc\\Model\\MetaData\\Exceptions\\NoPropertyAnnotationsForClass","httpStatus":null,"severity":"error","filePath":"phalcon/Mvc/Model/MetaData/Strategy/Annotations.zep","lineNumber":52,"sourceCode":"            throw new InvalidContainer();\n        }\n\n        let annotations = container->get(\"annotations\");\n\n        let className = get_class(model),\n            reflection = annotations->get(className);\n\n        if unlikely typeof reflection != \"object\" {\n            throw new NoAnnotationsForClass(className);\n        }\n\n        /**\n         * Get the properties defined in\n         */\n        let propertiesAnnotations = reflection->getPropertiesAnnotations();\n\n        if unlikely empty propertiesAnnotations {\n            throw new NoPropertyAnnotationsForClass(className);\n        }\n\n        let orderedColumnMap = [],\n            reversedColumnMap = [],\n            hasReversedColumn = false;\n\n        for property, propAnnotations in propertiesAnnotations {\n            /**\n             * All columns marked with the 'Column' annotation are considered columns\n             */\n            if !propAnnotations->has(\"Column\") {\n                continue;\n            }\n\n            /**\n             * Fetch the 'column' annotation\n             */\n            let columnAnnotation = propAnnotations->get(\"Column\");","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Mvc/Model/MetaData/Strategy/Annotations.zep#L34-L70","documentation":"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.","triggerScenarios":"Thrown at phalcon/Mvc/Model/MetaData/Strategy/Annotations.zep:52 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add the required ORM property annotations (@Column, @Primary, @Identity) to the model class","Switch the model's metadata strategy to introspection (Strategy\\Introspection) if the schema should be read from the database instead","Verify the annotations adapter is configured in the DI container and the file is readable"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b7419de9cd0a8a3f48441ead84c9f8415d463e25","analyzedAt":"2026-08-21T06:21:18.811Z","contentChangedAt":"2026-08-21T06:21:18.811Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}