/**
  * @param PostFlushEventArgs $eventArgs
  */
 public function postFlush(PostFlushEventArgs $eventArgs)
 {
     if (!empty($this->statuses)) {
         $documentManager = $eventArgs->getDocumentManager();
         foreach ($this->statuses as $status) {
             $documentManager->persist($status);
         }
         $this->statuses = array();
         $documentManager->flush();
     }
 }
 /**
  * @param PostFlushEventArgs $event
  */
 public function postFlush(PostFlushEventArgs $event)
 {
     if (!empty($this->folders)) {
         $documentManager = $event->getDocumentManager();
         foreach ($this->folders as $folder) {
             $documentManager->persist($folder);
         }
         $this->folders = array();
         $documentManager->flush();
     }
 }