[英]What are those annotation for? @param, @return, @var, and set in annotation of Entity
我想了解一些代碼中的以下注釋。 他們的目的是什么。 (我確實了解@Assert和@ORM,但不了解我在標題中提到的其他對象)
這是我看到的一個示例代碼。
class Image
{
/**
* Set url // is this line used by any code? Doctrine?
* @param string $url // is this line used by any code? Doctrine?
* @return Image // is this line used by any code? Doctrine?
*/
public function setUrl($url){
$this->url=$url;
return $this;
}
}
在這里和那里已經閱讀過,它僅用於文檔。 真正? 還是@ORM和@Assert,它們在構建應用程序中起着關鍵作用。
這僅用於文檔目的:
檢查Wiki以獲取所有這些文檔注釋的列表
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.