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

偶尔善良 提交于 2019-12-23 16:59:17

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/15274560/what-is-the-var-annotation-for-in-a-doctrine-entity-in-symfony

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!