mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-30 18:52:42 +01:00
dd206a5b69
Summary: Ref T603. Clean these up and move them to a single place. Test Plan: - Downloaded a raw diff. - Enabled "attach diffs", created a revision, got an email with a diff. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T603 Differential Revision: https://secure.phabricator.com/D7179
27 lines
551 B
PHP
27 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();
|
|
}
|
|
|
|
}
|