src/Command/Proxy/DoctrineCommandHelper.php
public static function setApplicationConnection(Application $application = null, $connName)
    {
        if (is_null($application)) {
            throw new \InvalidArgumentException('Application instance needed!');
        }

        $helperSet = $application->getHelperSet();

        /** @var ManagerRegistry $doctrine */
        $doctrine = $helperSet->get('doctrine');

        /** @var Connection $connection */
        $connection = $doctrine->getConnection($connName);

        $helperSet->set(new ConnectionHelper($connection), 'db');
    }
public static function setApplicationConnection(Application $application = null, $connName)
    {
        if (is_null($application)) {
            throw new \InvalidArgumentException('Application instance needed!');
        }

        $helperSet = $application->getHelperSet();

        /** @var ManagerRegistry $doctrine */
        $doctrine = $helperSet->get('doctrine');

        /** @var Connection $connection */
        $connection = $doctrine->getConnection($connName);

        $helperSet->set(new ConnectionHelper($connection), 'db');
    }
public static function setApplicationConnection ( Application $ application = null , $ connName ) { if ( is_null ( $ application ) ) { throw new \ InvalidArgumentException ( 'Application instance needed!' ) ; } $ helperSet = $ application -> getHelperSet ( ) ; /** @var ManagerRegistry $doctrine */ $ doctrine = $ helperSet -> get ( 'doctrine' ) ; /** @var Connection $connection */ $ connection = $ doctrine -> getConnection ( $ connName ) ; $ helperSet -> set ( new ConnectionHelper ( $ connection ) , 'db' ) ; }
Convenience method to push the helper sets of a given connection into the application.

@param  Application               $application
@param  string                    $connName
@throws \InvalidArgumentException
Convenience method to push the helper sets of a given connection into the application .