protected function persist($entity)
    {
        $manager = $this->getDoctrine()->getManager();
        $manager->persist($entity);
        $manager->flush();
    }
protected function persist($entity)
    {
        $manager = $this->getDoctrine()->getManager();
        $manager->persist($entity);
        $manager->flush();
    }
protected function persist ( $ entity ) { $ manager = $ this -> getDoctrine ( ) -> getManager ( ) ; $ manager -> persist ( $ entity ) ; $ manager -> flush ( ) ; }
Persists the entity and flush the entity manager.

@param object $entity
Persists the entity and flush the entity manager .