Services/UmbrellaFileUploader.php
public function createUmbrellaFile(UploadedFile $file, $upload = false)
    {
        $umbrellaFile = new UmbrellaFile();
        $umbrellaFile->name = $file->getClientOriginalName();
        $umbrellaFile->md5 = md5_file($file->getRealPath());
        $umbrellaFile->mimeType = $file->getMimeType();
        $umbrellaFile->size = $file->getSize();

        if ($upload) {
            $umbrellaFile->path = $this->upload($file);
        } else {
            $umbrellaFile->file = $file;
        }
        return $umbrellaFile;
    }
public function createUmbrellaFile(UploadedFile $file, $upload = false)
    {
        $umbrellaFile = new UmbrellaFile();
        $umbrellaFile->name = $file->getClientOriginalName();
        $umbrellaFile->md5 = md5_file($file->getRealPath());
        $umbrellaFile->mimeType = $file->getMimeType();
        $umbrellaFile->size = $file->getSize();

        if ($upload) {
            $umbrellaFile->path = $this->upload($file);
        } else {
            $umbrellaFile->file = $file;
        }
        return $umbrellaFile;
    }
public function createUmbrellaFile ( UploadedFile $ file , $ upload = false ) { $ umbrellaFile = new UmbrellaFile ( ) ; $ umbrellaFile -> name = $ file -> getClientOriginalName ( ) ; $ umbrellaFile -> md5 = md5_file ( $ file -> getRealPath ( ) ) ; $ umbrellaFile -> mimeType = $ file -> getMimeType ( ) ; $ umbrellaFile -> size = $ file -> getSize ( ) ; if ( $ upload ) { $ umbrellaFile -> path = $ this -> upload ( $ file ) ; } else { $ umbrellaFile -> file = $ file ; } return $ umbrellaFile ; }
Create Umbrella file from UploadedFile
If upload set to true => process upload else upload will be processed on postPersist

@param UploadedFile $file
@param bool $upload
@return UmbrellaFile
Create Umbrella file from UploadedFile If upload set to true = > process upload else upload will be processed on postPersist