mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-11 17:32:41 +01:00
28 lines
551 B
PHP
28 lines
551 B
PHP
|
<?php
|
||
|
|
||
|
/**
|
||
|
* Callback provider for loading @{class@arcanist:ArcanistBundle} file data
|
||
|
* stored in the Files application.
|
||
|
*/
|
||
|
final class PhabricatorFileBundleLoader {
|
||
|
|
||
|
private $viewer;
|
||
|
|
||
|
public function setViewer(PhabricatorUser $viewer) {
|
||
|
$this->viewer = $viewer;
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
public function loadFileData($phid) {
|
||
|
$file = id(new PhabricatorFileQuery())
|
||
|
->setViewer($this->viewer)
|
||
|
->withPHIDs(array($phid))
|
||
|
->executeOne();
|
||
|
if (!$file) {
|
||
|
return null;
|
||
|
}
|
||
|
return $file->loadFileData();
|
||
|
}
|
||
|
|
||
|
}
|