src/TrivialSense/FrameworkCommon/Container/ContainerHelperTrait.php
public function deleteAndFlush($entity, $entityManager = null)
    {
        $entityManager = $this->getEntityManager($entityManager);

        $entityManager->remove($entity);
        $entityManager->flush($entity);
    }
public function deleteAndFlush($entity, $entityManager = null)
    {
        $entityManager = $this->getEntityManager($entityManager);

        $entityManager->remove($entity);
        $entityManager->flush($entity);
    }
public function deleteAndFlush ( $ entity , $ entityManager = null ) { $ entityManager = $ this -> getEntityManager ( $ entityManager ) ; $ entityManager -> remove ( $ entity ) ; $ entityManager -> flush ( $ entity ) ; }
Remove and flush a given entity

@param $entity

@param string $entityManager
Remove and flush a given entity