Entity/File.php
public function moveUploadedFile()
    {
        $this->dateCreated = new DateTime();

        if (null === $this->_uploadedFile) {
            return;
        }

        $this->_uploadedFile->move(dirname($this->path), basename($this->path));
        $this->_uploadedFile = null;
    }
public function moveUploadedFile()
    {
        $this->dateCreated = new DateTime();

        if (null === $this->_uploadedFile) {
            return;
        }

        $this->_uploadedFile->move(dirname($this->path), basename($this->path));
        $this->_uploadedFile = null;
    }
public function moveUploadedFile ( ) { $ this -> dateCreated = new DateTime ( ) ; if ( null === $ this -> _uploadedFile ) { return ; } $ this -> _uploadedFile -> move ( dirname ( $ this -> path ) , basename ( $ this -> path ) ) ; $ this -> _uploadedFile = null ; }
Move Uploaded File

If the file was uploaded, then this method will move the uploaded file from the temporary
directory to its new path.

This is usually automatically handled as this method is a prePersist lifecycle callback.

@ORM\PrePersist
Move Uploaded File