src/DlcDoctrine/Event/FinishListener.php
public function onFinish($event)
    {
        $objectManager = $this->getObjectManager();
        $unitOfWork    = $objectManager->getUnitOfWork();
        
        if ($unitOfWork->size() > 0) {
            $objectManager->flush();
        }
    }
public function onFinish($event)
    {
        $objectManager = $this->getObjectManager();
        $unitOfWork    = $objectManager->getUnitOfWork();
        
        if ($unitOfWork->size() > 0) {
            $objectManager->flush();
        }
    }
public function onFinish ( $ event ) { $ objectManager = $ this -> getObjectManager ( ) ; $ unitOfWork = $ objectManager -> getUnitOfWork ( ) ; if ( $ unitOfWork -> size ( ) > 0 ) { $ objectManager -> flush ( ) ; } }
Listen to the "finish" event and attempt to flush changes

@param  MvcEvent $e
Listen to the finish event and attempt to flush changes