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

You Might Also Like
Our Free Plans just got better! | Auth0 by Okta Icon
Our Free Plans just got better! | Auth0 by Okta

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your secuirty. Auth0 now, thank yourself later.
Try free now
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