doctrine-orm - Doctrine 2 ORM 使用可恶的 CamelCase 创建类

标签 doctrine-orm getter-setter camelcasing

我为 Doctrine 创建了 yaml 配置。当我尝试时 doctrine orm:generate-entities ,它在 Camel 案例中创建带有 getter 和 setter 的 php 文件。所以,is_public字段转换为 setIsPublicgetIsPublic方法。太亏了我怎样才能得到set_is_publicget_is_public ?我可以手动编辑生成的 php 文件,但是我不知道更改架构后会发生什么。

最佳答案

Symfony's coding standards鼓励 Symfony 用户使用 Camel 箱 :

Naming Conventions

Use camelCase, not underscores, for variable, function and method names, arguments

关于doctrine-orm - Doctrine 2 ORM 使用可恶的 CamelCase 创建类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7573694/

相关文章:

php - Doctrine 2 注释和 "var"

symfony - 一张表中的关系

java - Java错误: The method setParent(IndexNode) is undefined for the type DocumentIndex and type IndexNode

android - getter函数中的空指针异常

forms - Symfony 2 表单现场 radio 需要=假?

php - 在 Symfony Doctrine 查询生成器中选择具有 x 标签的产品

java - 如何使用 getter 函数访问另一个类中的私有(private)变量?

匹配 Camel 和 Pascal Case 的正则表达式

regex - 上、下驼色案例

string - erlang中的驼峰式程序