src/Component/AuthManager.php
public function removeAll()
    {
        $pdo = $this->entityManager->getConnection()->getWrappedConnection();
        $pdo->beginTransaction();

        try {

            $pdo->exec('SET FOREIGN_KEY_CHECKS=0');
            $pdo->exec('TRUNCATE role_permission');
            $pdo->exec('TRUNCATE role_hierarchy');
            $pdo->exec('TRUNCATE role');
            $pdo->exec('TRUNCATE permission');
            $pdo->exec('TRUNCATE user_role');
            $pdo->exec('SET FOREIGN_KEY_CHECKS=1');

            $pdo->commit();

        } catch (\Exception $e) {
            $pdo->rollBack();
            throw new DatabaseException($e->getMessage());
        }
    }
public function removeAll()
    {
        $pdo = $this->entityManager->getConnection()->getWrappedConnection();
        $pdo->beginTransaction();

        try {

            $pdo->exec('SET FOREIGN_KEY_CHECKS=0');
            $pdo->exec('TRUNCATE role_permission');
            $pdo->exec('TRUNCATE role_hierarchy');
            $pdo->exec('TRUNCATE role');
            $pdo->exec('TRUNCATE permission');
            $pdo->exec('TRUNCATE user_role');
            $pdo->exec('SET FOREIGN_KEY_CHECKS=1');

            $pdo->commit();

        } catch (\Exception $e) {
            $pdo->rollBack();
            throw new DatabaseException($e->getMessage());
        }
    }
public function removeAll ( ) { $ pdo = $ this -> entityManager -> getConnection ( ) -> getWrappedConnection ( ) ; $ pdo -> beginTransaction ( ) ; try { $ pdo -> exec ( 'SET FOREIGN_KEY_CHECKS=0' ) ; $ pdo -> exec ( 'TRUNCATE role_permission' ) ; $ pdo -> exec ( 'TRUNCATE role_hierarchy' ) ; $ pdo -> exec ( 'TRUNCATE role' ) ; $ pdo -> exec ( 'TRUNCATE permission' ) ; $ pdo -> exec ( 'TRUNCATE user_role' ) ; $ pdo -> exec ( 'SET FOREIGN_KEY_CHECKS=1' ) ; $ pdo -> commit ( ) ; } catch ( \ Exception $ e ) { $ pdo -> rollBack ( ) ; throw new DatabaseException ( $ e -> getMessage ( ) ) ; } }
Truncates all tables
@throws DatabaseException
Truncates all tables