src/Utilities/QueryBuilderUtility.php
public static function deleteEntities(EntityManager $entityManager, $entities, $flushDeleted = true)
    {
        /*
         * No entities provided?
         * Nothing to do
         */
        if (empty($entities)) {
            return false;
        }

        foreach ($entities as $entity) {
            $entityManager->remove($entity);
        }

        // The deleted objects should be flushed?
        if ($flushDeleted) {
            $entityManager->flush();
        }

        return true;
    }
public static function deleteEntities(EntityManager $entityManager, $entities, $flushDeleted = true)
    {
        /*
         * No entities provided?
         * Nothing to do
         */
        if (empty($entities)) {
            return false;
        }

        foreach ($entities as $entity) {
            $entityManager->remove($entity);
        }

        // The deleted objects should be flushed?
        if ($flushDeleted) {
            $entityManager->flush();
        }

        return true;
    }
public static function deleteEntities ( EntityManager $ entityManager , $ entities , $ flushDeleted = true ) { /*
         * No entities provided?
         * Nothing to do
         */ if ( empty ( $ entities ) ) { return false ; } foreach ( $ entities as $ entity ) { $ entityManager -> remove ( $ entity ) ; } // The deleted objects should be flushed? if ( $ flushDeleted ) { $ entityManager -> flush ( ) ; } return true ; }
Deletes given entities

@param EntityManager         $entityManager The entity manager
@param array|ArrayCollection $entities      The entities to delete
@param bool                  $flushDeleted  (optional) If is set to true, flushes the deleted objects (default
behaviour). Otherwise - not.
@return bool
Deletes given entities