private function emptyTables(EntityManager $em)
    {
        $meta = $em->getClassMetadata('Alchemy\Phrasea\Model\Entities\User');
        $connection = $em->getConnection();
        $dbPlatform = $connection->getDatabasePlatform();

        if ($connection->getSchemaManager()->tablesExist([ $meta->getTableName() ])) {
            $connection->beginTransaction();

            try {
                $connection->query('SET FOREIGN_KEY_CHECKS=0');
                $connection->executeUpdate($dbPlatform->getTruncateTableSql($meta->getTableName()));
                $connection->query('SET FOREIGN_KEY_CHECKS=1');
                $connection->commit();
            } catch (\Exception $e) {
                $connection->rollback();
                throw $e;
            }
        }
    }
private function emptyTables(EntityManager $em)
    {
        $meta = $em->getClassMetadata('Alchemy\Phrasea\Model\Entities\User');
        $connection = $em->getConnection();
        $dbPlatform = $connection->getDatabasePlatform();

        if ($connection->getSchemaManager()->tablesExist([ $meta->getTableName() ])) {
            $connection->beginTransaction();

            try {
                $connection->query('SET FOREIGN_KEY_CHECKS=0');
                $connection->executeUpdate($dbPlatform->getTruncateTableSql($meta->getTableName()));
                $connection->query('SET FOREIGN_KEY_CHECKS=1');
                $connection->commit();
            } catch (\Exception $e) {
                $connection->rollback();
                throw $e;
            }
        }
    }
private function emptyTables ( EntityManager $ em ) { $ meta = $ em -> getClassMetadata ( 'Alchemy\Phrasea\Model\Entities\User' ) ; $ connection = $ em -> getConnection ( ) ; $ dbPlatform = $ connection -> getDatabasePlatform ( ) ; if ( $ connection -> getSchemaManager ( ) -> tablesExist ( [ $ meta -> getTableName ( ) ] ) ) { $ connection -> beginTransaction ( ) ; try { $ connection -> query ( 'SET FOREIGN_KEY_CHECKS=0' ) ; $ connection -> executeUpdate ( $ dbPlatform -> getTruncateTableSql ( $ meta -> getTableName ( ) ) ) ; $ connection -> query ( 'SET FOREIGN_KEY_CHECKS=1' ) ; $ connection -> commit ( ) ; } catch ( \ Exception $ e ) { $ connection -> rollback ( ) ; throw $ e ; } } }
Empty User & migration table.

@param EntityManager $em
Empty User & migration table .