Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the @var annotation for in a Doctrine entity in Symfony?

Perhaps a silly question but it bugs me that I don't know ...

When I create an entity with app/console doctrine:generate:entity it adds an @var annotation to each property. What is @var used for?

It obviously indicates the data type but I don't see it mentioned in any documentation and things seems to work whether it's there or not so I just wonder what uses it.

like image 905
tetranz Avatar asked Mar 07 '13 15:03

tetranz


1 Answers

This is a standard phpdoc comment. It has nothing to do with Doctrine annotations, and they are ignored by Doctrine. They are used when generating documentation and also as metadata for IDE's that support code completion.

like image 75
prodigitalson Avatar answered Nov 16 '22 18:11

prodigitalson