function FileUploadResult::setFile

Same name in other branches
  1. 9 core/modules/file/src/Upload/FileUploadResult.php \Drupal\file\Upload\FileUploadResult::setFile()
  2. 10 core/modules/file/src/Upload/FileUploadResult.php \Drupal\file\Upload\FileUploadResult::setFile()

Sets the File entity.

Parameters

\Drupal\file\FileInterface $file: A file entity.

Return value

$this

File

core/modules/file/src/Upload/FileUploadResult.php, line 110

Class

FileUploadResult
Value object for a file upload result.

Namespace

Drupal\file\Upload

Code

public function setFile(FileInterface $file) : FileUploadResult {
    $this->file = $file;
    return $this;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.