I added custom option to doctrine:fixtures:load command. Now I am wonder how to get this command option in custom fixtures class:
class LoadUserData implements FixtureInterface, ContainerAwareInterface {
private $container;
/**
* {@inheritDoc}
*/
public function load(ObjectManager $manager) {
}
public function setContainer(ContainerInterface $container = null) {
$this->container = $container;
}
}
Any suggestions?
So if you have extended
Doctrine\Bundle\FixturesBundle\Command\LoadDataFixturesDoctrineCommand
and managed to add a additional argument, then you can set that value passed as a container parameter.Then get that container parameter in your fixtures class.
The execute function is not call for me, i have to rename the command call:
on this way the command
will call your personal execute function.