1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-02 19:52:44 +01:00
phorge-phorge/src/applications/files/query/PhabricatorFileBundleLoader.php

28 lines
551 B
PHP
Raw Normal View History

<?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();
}
}