【问题标题】:symfony2 doctrine updating entities generates a .php file in entity directorysymfony2 学说更新实体在实体目录中生成一个 .php 文件
【发布时间】:2015-07-07 15:42:08
【问题描述】:

当我运行这个命令时:

php app/console doctrine:generate:entities MyBundleName

所有的setter和getter都是正确生成的,只是它在我的Entity目录中生成了一个.php文件

内容如下

<?php

namespace Goodeed\BEBundle\Entity;

use Doctrine\ORM\EntityRepository;

/**
 * 
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class  extends EntityRepository
{
}

所以如果我运行例如

php app/console doctrine:schema:update --force

我收到此错误:

我并不真正关心错误,因为当我删除文件时,一切都按预期工作,不再出现错误。所以我的问题是,什么会导致生成这个 .php 文件?

【问题讨论】:

    标签: php symfony doctrine-orm


    【解决方案1】:

    我的假设是您的实体中有这种注释:

     @ORM\Entity(repositoryClass="YourBundle\Entity\ ")
    

    使用此注释,您提示的命令具有此行为。

    希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多