Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // YourCommand.php
- use Symfony\Component\DependencyInjection\ContainerInterface;
- private $container;
- public function __construct(ContainerInterface $container)
- {
- parent::__construct();
- $this->container = $container;
- }
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $em = $this->container->get('doctrine')->getManager();
- // do stuff...
- }
Advertisement
Add Comment
Please, Sign In to add comment