Storage/DoctrineORMStorage.php
public function translationsTablesExist()
    {
        /** @var EntityManager $em */
        $em = $this->getManager();
        $connection = $em->getConnection();

        // listDatabases() is not available for SQLite
        if ('pdo_sqlite' !== $connection->getDriver()->getName()) {
            // init a tmp connection without dbname/path/url in case it does not exist yet
            $params = $connection->getParams();
            if (isset($params['master'])) {
                $params = $params['master'];
            }

            unset($params['dbname'], $params['path'], $params['url']);

            $tmpConnection = DriverManager::getConnection($params);
            try {
                $dbExists = in_array($connection->getDatabase(), $tmpConnection->getSchemaManager()->listDatabases());
            } catch (DBALException $e) {
                $dbExists = false;
            }
            $tmpConnection->close();

            if (!$dbExists) {
                return false;
            }
        }

        // checks tables exist
        $tables = array(
            $em->getClassMetadata($this->getModelClass('trans_unit'))->getTableName(),
            $em->getClassMetadata($this->getModelClass('translation'))->getTableName(),
        );

        return $connection->getSchemaManager()->tablesExist($tables);
    }
public function translationsTablesExist()
    {
        /** @var EntityManager $em */
        $em = $this->getManager();
        $connection = $em->getConnection();

        // listDatabases() is not available for SQLite
        if ('pdo_sqlite' !== $connection->getDriver()->getName()) {
            // init a tmp connection without dbname/path/url in case it does not exist yet
            $params = $connection->getParams();
            if (isset($params['master'])) {
                $params = $params['master'];
            }

            unset($params['dbname'], $params['path'], $params['url']);

            $tmpConnection = DriverManager::getConnection($params);
            try {
                $dbExists = in_array($connection->getDatabase(), $tmpConnection->getSchemaManager()->listDatabases());
            } catch (DBALException $e) {
                $dbExists = false;
            }
            $tmpConnection->close();

            if (!$dbExists) {
                return false;
            }
        }

        // checks tables exist
        $tables = array(
            $em->getClassMetadata($this->getModelClass('trans_unit'))->getTableName(),
            $em->getClassMetadata($this->getModelClass('translation'))->getTableName(),
        );

        return $connection->getSchemaManager()->tablesExist($tables);
    }
public function translationsTablesExist ( ) { /** @var EntityManager $em */ $ em = $ this -> getManager ( ) ; $ connection = $ em -> getConnection ( ) ; // listDatabases() is not available for SQLite if ( 'pdo_sqlite' !== $ connection -> getDriver ( ) -> getName ( ) ) { // init a tmp connection without dbname/path/url in case it does not exist yet $ params = $ connection -> getParams ( ) ; if ( isset ( $ params [ 'master' ] ) ) { $ params = $ params [ 'master' ] ; } unset ( $ params [ 'dbname' ] , $ params [ 'path' ] , $ params [ 'url' ] ) ; $ tmpConnection = DriverManager :: getConnection ( $ params ) ; try { $ dbExists = in_array ( $ connection -> getDatabase ( ) , $ tmpConnection -> getSchemaManager ( ) -> listDatabases ( ) ) ; } catch ( DBALException $ e ) { $ dbExists = false ; } $ tmpConnection -> close ( ) ; if ( ! $ dbExists ) { return false ; } } // checks tables exist $ tables = array ( $ em -> getClassMetadata ( $ this -> getModelClass ( 'trans_unit' ) ) -> getTableName ( ) , $ em -> getClassMetadata ( $ this -> getModelClass ( 'translation' ) ) -> getTableName ( ) , ) ; return $ connection -> getSchemaManager ( ) -> tablesExist ( $ tables ) ; }
Returns true if translation tables exist.

@return boolean
Returns true if translation tables exist .