public function setFile(UploadedFile $file = null)
    {
        $this->file = $file;
        $this->name = $file->getClientOriginalName();
        // check if we have an old image path
        if (isset($this->path)) {
            // store the old name to delete after the update
            $this->temp = $this->path;
            $this->path = null;
        } else {
            $this->path = 'initial';
        }
    }
public function setFile(UploadedFile $file = null)
    {
        $this->file = $file;
        $this->name = $file->getClientOriginalName();
        // check if we have an old image path
        if (isset($this->path)) {
            // store the old name to delete after the update
            $this->temp = $this->path;
            $this->path = null;
        } else {
            $this->path = 'initial';
        }
    }
public function setFile ( UploadedFile $ file = null ) { $ this -> file = $ file ; $ this -> name = $ file -> getClientOriginalName ( ) ; // check if we have an old image path if ( isset ( $ this -> path ) ) { // store the old name to delete after the update $ this -> temp = $ this -> path ; $ this -> path = null ; } else { $ this -> path = 'initial' ; } }
Sets file.

@param UploadedFile $file
Sets file .