plugin/drop-zone/Manager/DropzoneManager.php
public function createFilesDocuments(Drop $drop, User $user, array $files)
    {
        $documents = [];
        $documentEntities = [];
        $currentDate = new \DateTime();
        $dropzone = $drop->getDropzone();
        $this->om->startFlushSuite();

        foreach ($files as $file) {
            $document = new Document();
            $document->setDrop($drop);
            $document->setUser($user);
            $document->setDropDate($currentDate);
            $document->setType(Document::DOCUMENT_TYPE_FILE);
            $data = $this->registerUplodadedFile($dropzone, $file);
            $document->setFile($data);
            $this->om->persist($document);
            $documentEntities[] = $document;
            $documents[] = $this->serializeDocument($document);
        }
        $this->om->endFlushSuite();

        //tracking for each document, after flush
        foreach ($documentEntities as $entity) {
            $this->eventDispatcher->dispatch('log', new LogDocumentCreateEvent($drop->getDropzone(), $drop, $entity));
        }

        return $documents;
    }
public function createFilesDocuments(Drop $drop, User $user, array $files)
    {
        $documents = [];
        $documentEntities = [];
        $currentDate = new \DateTime();
        $dropzone = $drop->getDropzone();
        $this->om->startFlushSuite();

        foreach ($files as $file) {
            $document = new Document();
            $document->setDrop($drop);
            $document->setUser($user);
            $document->setDropDate($currentDate);
            $document->setType(Document::DOCUMENT_TYPE_FILE);
            $data = $this->registerUplodadedFile($dropzone, $file);
            $document->setFile($data);
            $this->om->persist($document);
            $documentEntities[] = $document;
            $documents[] = $this->serializeDocument($document);
        }
        $this->om->endFlushSuite();

        //tracking for each document, after flush
        foreach ($documentEntities as $entity) {
            $this->eventDispatcher->dispatch('log', new LogDocumentCreateEvent($drop->getDropzone(), $drop, $entity));
        }

        return $documents;
    }
public function createFilesDocuments ( Drop $ drop , User $ user , array $ files ) { $ documents = [ ] ; $ documentEntities = [ ] ; $ currentDate = new \ DateTime ( ) ; $ dropzone = $ drop -> getDropzone ( ) ; $ this -> om -> startFlushSuite ( ) ; foreach ( $ files as $ file ) { $ document = new Document ( ) ; $ document -> setDrop ( $ drop ) ; $ document -> setUser ( $ user ) ; $ document -> setDropDate ( $ currentDate ) ; $ document -> setType ( Document :: DOCUMENT_TYPE_FILE ) ; $ data = $ this -> registerUplodadedFile ( $ dropzone , $ file ) ; $ document -> setFile ( $ data ) ; $ this -> om -> persist ( $ document ) ; $ documentEntities [ ] = $ document ; $ documents [ ] = $ this -> serializeDocument ( $ document ) ; } $ this -> om -> endFlushSuite ( ) ; //tracking for each document, after flush foreach ( $ documentEntities as $ entity ) { $ this -> eventDispatcher -> dispatch ( 'log' , new LogDocumentCreateEvent ( $ drop -> getDropzone ( ) , $ drop , $ entity ) ) ; } return $ documents ; }
Creates Files Documents.

@param Drop  $drop
@param User  $user
@param array $files

@return array
Creates Files Documents .