This command looks for all services tagged with doctrine.fixture.orm
.
There is two ways to fix this problem.
First one: any class that implements ORMFixtureInterface
will automatically be registered with this tag.
<?php
namespace AppBundleDataFixturesORM;
use DoctrineBundleFixturesBundleORMFixtureInterface;
use DoctrineCommonPersistenceObjectManager;
class LoadFixtures implements ORMFixtureInterface
{
public function load(ObjectManager $manager)
{
#your code
}
}
Second one: You need manually tag doctrine.fixture.orm
to DataFixtures
in sevice.yml
configuration.
services:
...
# makes classes in src/AppBundle/DataFixtures available to be used as services
# and have a tag that allows actions to type-hint services
AppBundleDataFixtures:
resource: '../../src/AppBundle/DataFixtures'
tags: ['doctrine.fixture.orm']
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…