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

        $entityManager->persist($entity);
        $entityManager->flush($persistAll ? null : $entity);
    }
public function persistAndFlush($entity, $persistAll = false, $entityManager = null)
    {
        $entityManager = $this->getEntityManager($entityManager);

        $entityManager->persist($entity);
        $entityManager->flush($persistAll ? null : $entity);
    }
public function persistAndFlush ( $ entity , $ persistAll = false , $ entityManager = null ) { $ entityManager = $ this -> getEntityManager ( $ entityManager ) ; $ entityManager -> persist ( $ entity ) ; $ entityManager -> flush ( $ persistAll ? null : $ entity ) ; }
Persist and flush a given entity

@param $entity

@param string $entityManager
Persist and flush a given entity