Doctrine Annotations allows to implement custom annotation functionality for PHP classes. Annotations aren't implemented in PHP itself which is why this component offers a way to use the PHP doc-blocks as a place for the well known annotation syntax using the @ char. Annotations in Doctrine are used for the ORM configuration to build the class mapping, but it can be used in other projects for other purposes too. You can install the Annotation component with composer. The access to the annotations happens by reflection of the class containing them. There are multiple reader-classes implementing the Doctrine\Common\Annotations\Reader interface, that can access the annotations of a class. A common one is Doctrine\Common\Annotations\AnnotationReader. Note that AnnotationRegistry::registerLoader('class_exists') only works if you already have an autoloader configured (i.e. composer autoloader). Otherwise, please take a look to the other annotation autoload mechanisms.

Features

  • A reader has multiple methods to access the annotations of a class
  • The annotation class is declared as an annotation by @Annotation
  • An annotation class is a representation of the later used annotation configuration in classes
  • You can install the Annotation component with composer
  • Annotations in Doctrine are used for the ORM configuration to build the class mapping
  • It can be used in other projects for other purposes too

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow Doctrine Annotations

Doctrine Annotations Web Site

Other Useful Business Software
Full-stack observability with actually useful AI | Grafana Cloud Icon
Full-stack observability with actually useful AI | Grafana Cloud

Our generous forever free tier includes the full platform, including the AI Assistant, for 3 users with 10k metrics, 50GB logs, and 50GB traces.

Built on open standards like Prometheus and OpenTelemetry, Grafana Cloud includes Kubernetes Monitoring, Application Observability, Incident Response, plus the AI-powered Grafana Assistant. Get started with our generous free tier today.
Create free account
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Doctrine Annotations!

Additional Project Details

Programming Language

PHP

Related Categories

PHP Text Editors, PHP Libraries

Registered

2021-09-08