protected function createFileHistory(PostPersistEvent $event)
    {
        // Find original filename in request uploaded file
        $files = $event->getRequest()->files->all();
        $uploadedFile = array_pop($files);
        $originalFileName = $uploadedFile->getClientOriginalName();

        // Get generated filename
        $fileName = $event->getFile()->getBasename();

        // Fill FileHistory object
        return $this->fileHistoryManager->createAndSave($fileName, $originalFileName, $event->getType());
    }
protected function createFileHistory(PostPersistEvent $event)
    {
        // Find original filename in request uploaded file
        $files = $event->getRequest()->files->all();
        $uploadedFile = array_pop($files);
        $originalFileName = $uploadedFile->getClientOriginalName();

        // Get generated filename
        $fileName = $event->getFile()->getBasename();

        // Fill FileHistory object
        return $this->fileHistoryManager->createAndSave($fileName, $originalFileName, $event->getType());
    }
protected function createFileHistory ( PostPersistEvent $ event ) { // Find original filename in request uploaded file $ files = $ event -> getRequest ( ) -> files -> all ( ) ; $ uploadedFile = array_pop ( $ files ) ; $ originalFileName = $ uploadedFile -> getClientOriginalName ( ) ; // Get generated filename $ fileName = $ event -> getFile ( ) -> getBasename ( ) ; // Fill FileHistory object return $ this -> fileHistoryManager -> createAndSave ( $ fileName , $ originalFileName , $ event -> getType ( ) ) ; }
Create a filehistory to retrieve original name and uploading user

@param PostPersistEvent $event

@return FileHistory
Create a filehistory to retrieve original name and uploading user