如何在Doctrine 2中使用标志readOnly?

aut*_*tix 2 entity annotations doctrine-orm

Doctrine 实体可以拥有该标志readOnly.

该旗应该如何readOnly使用?

/** @Entity(readOnly) */ <-- like this?
/** @Entity(readOnly=true) */ <-- or like this?
class User
{
    //...
}
Run Code Online (Sandbox Code Playgroud)

Fro*_*y Z 10

根据这个答案这个问题,后者是要走的路:

/** @Entity(readOnly=true) */
Run Code Online (Sandbox Code Playgroud)