Common\Doctrine\ValueObject\AbstractFile::setFile PHP Метод

setFile() публичный Метод

Sets file.
public setFile ( Symfony\Component\HttpFoundation\File\UploadedFile $file = null ) : static
$file Symfony\Component\HttpFoundation\File\UploadedFile
Результат static
    public function setFile(UploadedFile $file = null)
    {
        if ($file === null) {
            return $this;
        }
        $this->file = $file;
        // check if we have an old image path
        if ($this->fileName === null) {
            return $this;
        }
        // store the old name to delete after the update
        $this->oldFileName = $this->fileName;
        $this->fileName = null;
        return clone $this;
    }