private function getRegistryConfig($bundleId, $scopePerContext, $scopePerEnvironment)
    {
        $registry = null;

        try {
            if (null !== $em = $this->application->getEntityManager()) {
                $registry = $em->getRepository('BackBee\Bundle\Registry')->findOneBy(array(
                    'key' => $bundleId,
                    'scope' => $this->getRegistryScope('BUNDLE_CONFIG', $scopePerContext, $scopePerEnvironment),
                ));
            }
        } catch (DBALException $e) {
            $expectedError = false;
            if (null !== $e->getPrevious() && $e->getPrevious() instanceof \PDOException) {
                // expected error is if we try to get overrided config in registry on application installation process
                // PDOException has two methods for retrieving information about an error
                // @see http://php.net/manual/en/class.pdoexception.php
                $expectedError = (
                    '42S02' === $e->getPrevious()->getCode()
                    || false !== strpos($e->getPrevious()->getMessage(), 'SQLSTATE[42S02]')
                );
            }

            if (false === $expectedError) {
                throw $e;
            }
        }

        return $registry;
    }
private function getRegistryConfig($bundleId, $scopePerContext, $scopePerEnvironment)
    {
        $registry = null;

        try {
            if (null !== $em = $this->application->getEntityManager()) {
                $registry = $em->getRepository('BackBee\Bundle\Registry')->findOneBy(array(
                    'key' => $bundleId,
                    'scope' => $this->getRegistryScope('BUNDLE_CONFIG', $scopePerContext, $scopePerEnvironment),
                ));
            }
        } catch (DBALException $e) {
            $expectedError = false;
            if (null !== $e->getPrevious() && $e->getPrevious() instanceof \PDOException) {
                // expected error is if we try to get overrided config in registry on application installation process
                // PDOException has two methods for retrieving information about an error
                // @see http://php.net/manual/en/class.pdoexception.php
                $expectedError = (
                    '42S02' === $e->getPrevious()->getCode()
                    || false !== strpos($e->getPrevious()->getMessage(), 'SQLSTATE[42S02]')
                );
            }

            if (false === $expectedError) {
                throw $e;
            }
        }

        return $registry;
    }
private function getRegistryConfig ( $ bundleId , $ scopePerContext , $ scopePerEnvironment ) { $ registry = null ; try { if ( null !== $ em = $ this -> application -> getEntityManager ( ) ) { $ registry = $ em -> getRepository ( 'BackBee\Bundle\Registry' ) -> findOneBy ( array ( 'key' => $ bundleId , 'scope' => $ this -> getRegistryScope ( 'BUNDLE_CONFIG' , $ scopePerContext , $ scopePerEnvironment ) , ) ) ; } } catch ( DBALException $ e ) { $ expectedError = false ; if ( null !== $ e -> getPrevious ( ) && $ e -> getPrevious ( ) instanceof \ PDOException ) { // expected error is if we try to get overrided config in registry on application installation process // PDOException has two methods for retrieving information about an error // @see http://php.net/manual/en/class.pdoexception.php $ expectedError = ( '42S02' === $ e -> getPrevious ( ) -> getCode ( ) || false !== strpos ( $ e -> getPrevious ( ) -> getMessage ( ) , 'SQLSTATE[42S02]' ) ) ; } if ( false === $ expectedError ) { throw $ e ; } } return $ registry ; }
Returns the registry entry for bundle's config storing.

@param  string  $bundleId            The id of the bundle we are looking for override config in registry.
@param  boolean $scopePerContext     If TRUE use context in registry scope.
@param  boolean $scopePerEnvironment If TRUE use environment in regsitry scope.

@return \BackBee\Bundle\Registry|NULL
Returns the registry entry for bundle s config storing .