public function preTruncate(LifecycleEventArgs $args)
    {
        $connection = $args->getObjectManager()->getConnection();
        $platform   = $connection->getDatabasePlatform();

        if ($platform instanceof MySqlPlatform) {
            $connection->exec('SET foreign_key_checks = 0;');
        }
    }
public function preTruncate(LifecycleEventArgs $args)
    {
        $connection = $args->getObjectManager()->getConnection();
        $platform   = $connection->getDatabasePlatform();

        if ($platform instanceof MySqlPlatform) {
            $connection->exec('SET foreign_key_checks = 0;');
        }
    }
public function preTruncate ( LifecycleEventArgs $ args ) { $ connection = $ args -> getObjectManager ( ) -> getConnection ( ) ; $ platform = $ connection -> getDatabasePlatform ( ) ; if ( $ platform instanceof MySqlPlatform ) { $ connection -> exec ( 'SET foreign_key_checks = 0;' ) ; } }
Pre-truncate

@param \Doctrine\Common\Persistence\Event\LifecycleEventArgs $args
Pre - truncate