Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/files/query/PhabricatorFileBundleLoader.php
12242 views
1
<?php
2
3
/**
4
* Callback provider for loading @{class@arcanist:ArcanistBundle} file data
5
* stored in the Files application.
6
*/
7
final class PhabricatorFileBundleLoader extends Phobject {
8
9
private $viewer;
10
11
public function setViewer(PhabricatorUser $viewer) {
12
$this->viewer = $viewer;
13
return $this;
14
}
15
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;
23
}
24
return $file->loadFileData();
25
}
26
27
}
28
29