1

我在我的项目中使用 Symfony3 和 Doctrine ORM。现在我想用 Hautelook/AliceBundle 制作一些不错的固定装置。

所以我正在安装捆绑包,将其注册到 AppKernel 以及在配置中创建一个条目。

我添加了一个这样的 DataLoader:

use Hautelook\AliceBundle\Doctrine\DataFixtures\AbstractLoader;

class DataLoader extends AbstractLoader
{
/**
 * {@inheritdoc}
 */
public function getFixtures()
{
    return [
        __DIR__.'/../ORM/user.yml',
    ];
}
}

现在,如果我尝试运行以下命令:

 sf hautelook_alice:doctrine:fixtures:load

我收到错误消息:

[Symfony\Component\Debug\Exception\UndefinedMethodException]                                                    
Attempted to call an undefined method named "addClass" of class "Doctrine\ORM\Internal\CommitOrderCalculator".

我的 composer.json 包含:

"doctrine/orm"                                          : "^2.5.4",
"doctrine/doctrine-bundle"                              : "^1.6",
"doctrine/data-fixtures"                                : "^1.1",
"hautelook/alice-bundle"                                : "^1.2",
"doctrine/doctrine-fixtures-bundle"                     : "^2.3",

我真的不知道这里的问题是什么,我希望任何人都可以帮助我找出或知道解决方案。如果缺少任何信息,我将添加它。

提前谢谢

4

1 回答 1

1

我可以通过对我的 composer.json 进行以下更改来解决这个问题:

"doctrine/data-fixtures": "dev-topological-sorter as 1.1.x-dev"

该问题已在 github 上链接,但尚未合并。你可以在这里读更多关于它的内容:

https://github.com/doctrine/data-fixtures/pull/222/commits/987e5f35142ac4ac5dc60a16d1eb18293964bc25

我希望这将有助于其他有同样问题的人。

感谢 Alvin 试图帮助我。

于 2016-06-16T08:45:35.067 回答