Symfony的Doctrine实体中的@var注释是什么? [英] What is the @var annotation for in a Doctrine entity in Symfony?

查看:295
本文介绍了Symfony的Doctrine实体中的@var注释是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能是一个愚蠢的问题,但是我错了,我不知道...

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

当我创建一个具有应用程序/控制台的实体doctrine:generate:entity 它为每个属性添加一个 @var 注释。什么是 @var 用于?

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.

推荐答案

这是一个标准的< a href =http://www.phpdoc.org/ =noreferrer> phpdoc 评论。它与Doctrine注释无关,它们被Doctrine忽略。它们在生成文档时使用,也可用作支持代码完成的IDE的元数据。

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.

这篇关于Symfony的Doctrine实体中的@var注释是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆