Getting Doctrine for a Symfony console command -


how instance of doctrine symfony console command app? need run tasks via cron job , need access database , send emails too.

your command must extends symfony\bundle\frameworkbundle\command\containerawarecommandclass.

then :

$em = $this->getcontainer()->get('doctrine')->getmanager(); 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -