Open shehi opened 4 years ago
Have you tried doctrine.fixture.odm.mongodb
as tag name?
Got similar issue.
What fixed it was extending the fixture with Doctrine\Bundle\MongoDBBundle\Fixture\Fixture
. I was using Doctrine\Bundle\FixturesBundle\Fixture
before :facepalm:
After changing to MongoDBBundle
command sees and run it. I've removed it from services config after that and it's still being found by the command.
<?php
namespace App\DataFixtures;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Persistence\ObjectManager;
class AppFixtures extends \Doctrine\Bundle\MongoDBBundle\Fixture\Fixture
{
public function load(ObjectManager $manager)
{
...
}
}
You can also declare your package and put an alias, the fixture package is also not needed as the MongoDBBundle one extends the FixturesInterface uses the ORM one.
<?php
namespace App\DataFixtures;
use Doctrine\Persistence\ObjectManager;
use Doctrine\Bundle\MongoDBBundle\Fixture\Fixture as MongoFixture;
class AppFixtures extends MongoFixture
{
public function load(ObjectManager $manager)
{
...
}
}
service:
service registration is as such:
./bin/console debug:autowiring --all -- Fixture
:YET,
./bin/console doctrine:mongodb:fixtures:load -n -vvv
tells me:[ERROR] Could not find any fixture services to load.
What am I doing wrong? Thanks.