/** * @param $orm */ public function ormCommands($orm) { if (is_array($orm) && in_array('doctrine', $orm)) { /** @var EntityManager $em */ $em = Model::orm('doctrine')->getOrm(); $helperSet = ConsoleRunner::createHelperSet($em); $this->cli->setCatchExceptions(true); $this->cli->setHelperSet($helperSet); ConsoleRunner::addCommands($this->cli); } }
/** * @param bool $enable */ public function setDebugBar($enable = true) { if ($this->env == 'dev' && $enable) { $debugStack = new DebugStack(); Model::orm('doctrine')->getOrm()->getConnection()->getConfiguration()->setSQLLogger($debugStack); $this->app->get('debug_toolbar')->loadDoctrineDebugger($debugStack); } }