public function flush($entity)
    {
        /**
         * @var ObjectManager $objectManager
         */
        $objectManager = $this
            ->get('elcodi.provider.manager')
            ->getManagerByEntityNamespace(get_class($entity));

        $objectManager->persist($entity);
        $objectManager->flush($entity);

        return $this;
    }
public function flush($entity)
    {
        /**
         * @var ObjectManager $objectManager
         */
        $objectManager = $this
            ->get('elcodi.provider.manager')
            ->getManagerByEntityNamespace(get_class($entity));

        $objectManager->persist($entity);
        $objectManager->flush($entity);

        return $this;
    }
public function flush ( $ entity ) { /**
         * @var ObjectManager $objectManager
         */ $ objectManager = $ this -> get ( 'elcodi.provider.manager' ) -> getManagerByEntityNamespace ( get_class ( $ entity ) ) ; $ objectManager -> persist ( $ entity ) ; $ objectManager -> flush ( $ entity ) ; return $ this ; }
Save an entity. To ensure the method is simple, the entity will be
persisted always.

@param mixed $entity Entity

@return $this Self object
Save an entity . To ensure the method is simple the entity will be persisted always .