Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / files / query / PhabricatorFileBundleLoader.php
blob76b90debf6e6f97c3842d37830e4127a81e383e6
1 <?php
3 /**
4 * Callback provider for loading @{class@arcanist:ArcanistBundle} file data
5 * stored in the Files application.
6 */
7 final class PhabricatorFileBundleLoader extends Phobject {
9 private $viewer;
11 public function setViewer(PhabricatorUser $viewer) {
12 $this->viewer = $viewer;
13 return $this;
16 public function loadFileData($phid) {
17 $file = id(new PhabricatorFileQuery())
18 ->setViewer($this->viewer)
19 ->withPHIDs(array($phid))
20 ->executeOne();
21 if (!$file) {
22 return null;
24 return $file->loadFileData();