mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-18 19:40:55 +01:00
b6d745b666
Summary: All classes should extend from some other class. See D13275 for some explanation. Test Plan: `arc unit` Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D13283
27 lines
568 B
PHP
27 lines
568 B
PHP
<?php
|
|
|
|
/**
|
|
* Callback provider for loading @{class@arcanist:ArcanistBundle} file data
|
|
* stored in the Files application.
|
|
*/
|
|
final class PhabricatorFileBundleLoader extends Phobject {
|
|
|
|
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();
|
|
}
|
|
|
|
}
|