1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-27 16:00:59 +01:00

Set viewer for all handles loaded in controllers

Summary:
I've replaced all `id(new PhabricatorObjectHandleData(...))->loadHandles()` by `$this->loadViewerHandles(...)`.
Lint caught one usage in a static method.

Test Plan: Displayed revision with sporadic author.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3432
This commit is contained in:
vrana 2012-09-04 19:02:56 -07:00
parent efd59322f2
commit 8ff52c0b6c
65 changed files with 91 additions and 139 deletions

View file

@ -54,7 +54,7 @@ final class PhabricatorAuditAddCommentController
->addCCs($ccs)
->addComment($comment);
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$uri = $handles[$commit_phid]->getURI();
$draft = id(new PhabricatorDraft())->loadOneWhere(

View file

@ -228,7 +228,7 @@ final class PhabricatorAuditListController extends PhabricatorAuditController {
}
$phids = array($phid);
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$handle = $handles[$phid];
$this->validateHandle($handle);
@ -393,7 +393,7 @@ final class PhabricatorAuditListController extends PhabricatorAuditController {
$view->setNoDataString($nodata);
$phids = $view->getRequiredHandlePHIDs();
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$view->setHandles($handles);
$panel = new AphrontPanelView();
@ -485,7 +485,7 @@ final class PhabricatorAuditListController extends PhabricatorAuditController {
$view->setNoDataString($nodata);
$phids = $view->getRequiredHandlePHIDs();
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$view->setHandles($handles);
$panel = new AphrontPanelView();

View file

@ -68,7 +68,7 @@ final class PhabricatorAuditPreviewController
$phids = array_merge($phids, $view->getRequiredHandlePHIDs());
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$view->setHandles($handles);
id(new PhabricatorDraft())

View file

@ -217,10 +217,14 @@ abstract class PhabricatorController extends AphrontController {
protected function loadHandles(array $phids) {
$phids = array_filter($phids);
$this->handles = id(new PhabricatorObjectHandleData($phids))
$this->handles = $this->loadViewerHandles($phids);
return $this;
}
protected function loadViewerHandles(array $phids) {
return id(new PhabricatorObjectHandleData($phids))
->setViewer($this->getRequest()->getUser())
->loadHandles();
return $this;
}
protected function renderHandlesForPHIDs(array $phids) {

View file

@ -43,7 +43,7 @@ final class PhabricatorCalendarBrowseController
$month_view->setHolidays($holidays);
$phids = mpull($statuses, 'getUserPHID');
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
foreach ($statuses as $status) {
$event = new AphrontCalendarEventView();

View file

@ -36,7 +36,7 @@ final class PhabricatorCountdownListController
$timers = $pager->sliceResults($timers);
$phids = mpull($timers, 'getAuthorPHID');
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$rows = array();
foreach ($timers as $timer) {

View file

@ -203,8 +203,7 @@ final class DifferentialChangesetViewController extends DifferentialController {
}
$phids = array_keys($phids);
$handles = id(new PhabricatorObjectHandleData($phids))
->loadHandles();
$handles = $this->loadViewerHandles($phids);
$parser->setHandles($handles);
$engine = PhabricatorMarkupEngine::newDifferentialMarkupEngine();

View file

@ -59,9 +59,7 @@ final class DifferentialCommentPreviewController
$handles = array_merge($handles, $ccs);
}
$handles = id(new PhabricatorObjectHandleData($handles))
->setViewer($request->getUser())
->loadHandles();
$handles = $this->loadViewerHandles($handles);
$view = new DifferentialRevisionCommentView();
$view->setUser($request->getUser());

View file

@ -92,8 +92,7 @@ final class DifferentialRevisionEditController extends DifferentialController {
}
$phids = array_mergev($aux_phids);
$phids = array_unique($phids);
$handles = id(new PhabricatorObjectHandleData($phids))
->loadHandles();
$handles = $this->loadViewerHandles($phids);
foreach ($aux_fields as $key => $aux_field) {
$aux_field->setHandles(array_select_keys($handles, $aux_phids[$key]));
}

View file

@ -172,9 +172,7 @@ final class DifferentialRevisionListController extends DifferentialController {
}
$phids = array_mergev(mpull($view_objects, 'getRequiredHandlePHIDs'));
$phids[] = $params['phid'];
$handles = id(new PhabricatorObjectHandleData($phids))
->setViewer($this->getRequest()->getUser())
->loadHandles();
$handles = $this->loadViewerHandles($phids);
foreach ($views as $view) {
if (empty($view['special'])) {

View file

@ -125,8 +125,7 @@ final class DifferentialRevisionStatsController extends DifferentialController {
DifferentialAction::ACTION_CLOSE);
$panels = array();
$handles = id(new PhabricatorObjectHandleData(array($params['phid'])))
->loadHandles();
$handles = $this->loadViewerHandles(array($params['phid']));
$filter_form = id(new AphrontFormView())
->setAction('/differential/stats/'.$this->filter.'/')

View file

@ -144,9 +144,7 @@ final class DifferentialRevisionViewController extends DifferentialController {
$object_phids = array_merge($object_phids, array_mergev($aux_phids));
$object_phids = array_unique($object_phids);
$handles = id(new PhabricatorObjectHandleData($object_phids))
->setViewer($this->getRequest()->getUser())
->loadHandles();
$handles = $this->loadViewerHandles($object_phids);
foreach ($aux_fields as $key => $aux_field) {
// Make sure each field only has access to handles it specifically
@ -883,9 +881,7 @@ final class DifferentialRevisionViewController extends DifferentialController {
->loadAssets();
$phids = $view->getRequiredHandlePHIDs();
$handles = id(new PhabricatorObjectHandleData($phids))
->setViewer($this->getRequest()->getUser())
->loadHandles();
$handles = $this->loadViewerHandles($phids);
$view->setHandles($handles);
return

View file

@ -79,7 +79,7 @@ final class DiffusionBrowseController extends DiffusionController {
}
$phids = array_keys($phids);
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$browse_table = new DiffusionBrowseTableView();
$browse_table->setDiffusionRequest($drequest);

View file

@ -361,8 +361,7 @@ final class DiffusionCommitController extends DiffusionController {
$handles = array();
if ($phids) {
$handles = id(new PhabricatorObjectHandleData($phids))
->loadHandles();
$handles = $this->loadViewerHandles($phids);
}
$props = array();
@ -469,7 +468,7 @@ final class DiffusionCommitController extends DiffusionController {
$view->setShowDescriptions(false);
$phids = $view->getRequiredHandlePHIDs();
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$view->setHandles($handles);
$view->setAuthorityPHIDs($this->auditAuthorityPHIDs);
$this->highlightedAudits = $view->getHighlightedAudits();
@ -509,7 +508,7 @@ final class DiffusionCommitController extends DiffusionController {
$view->setPathMap($path_map);
$phids = $view->getRequiredHandlePHIDs();
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$view->setHandles($handles);
return $view;
@ -757,7 +756,7 @@ final class DiffusionCommitController extends DiffusionController {
$history_table->loadRevisions();
$phids = $history_table->getRequiredHandlePHIDs();
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$history_table->setHandles($handles);
$panel = new AphrontPanelView();

View file

@ -42,8 +42,7 @@ final class DiffusionCommitEditController extends DiffusionController {
$commit_phid,
$edge_type
);
$handles = id(new PhabricatorObjectHandleData($current_proj_phids))
->loadHandles();
$handles = $this->loadViewerHandles($current_proj_phids);
$proj_t_values = mpull($handles, 'getFullName', 'getPHID');
if ($request->isFormPost()) {

View file

@ -141,7 +141,7 @@ abstract class DiffusionController extends PhabricatorController {
->loadAssets();
$phids = $view->getRequiredHandlePHIDs();
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$view->setHandles($handles);
$panel = new AphrontPanelView();

View file

@ -94,7 +94,7 @@ final class DiffusionDiffController extends DiffusionController {
}
$phids = mpull($inlines, 'getAuthorPHID');
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$parser->setHandles($handles);
}

View file

@ -84,7 +84,7 @@ final class DiffusionHistoryController extends DiffusionController {
$history_table->loadRevisions();
$phids = $history_table->getRequiredHandlePHIDs();
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$history_table->setHandles($handles);
if ($show_graph) {

View file

@ -37,7 +37,7 @@ final class DiffusionLastModifiedController extends DiffusionController {
}
$phids = array_keys($phids);
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$output = DiffusionBrowseTableView::renderLastModifiedColumns(
$drequest->getRepository(),

View file

@ -64,7 +64,7 @@ final class DiffusionRepositoryController extends DiffusionController {
}
$phids = array_keys($phids);
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$history_table = new DiffusionHistoryTableView();
$history_table->setDiffusionRequest($drequest);
@ -240,7 +240,7 @@ final class DiffusionRepositoryController extends DiffusionController {
$view->setCommits($commits);
$phids = $view->getRequiredHandlePHIDs();
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$view->setHandles($handles);
$panel = new AphrontPanelView();

View file

@ -72,7 +72,7 @@ final class DiffusionTagListController extends DiffusionController {
->setDiffusionRequest($drequest);
$phids = $view->getRequiredHandlePHIDs();
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$view->setHandles($handles);
$panel = id(new AphrontPanelView())

View file

@ -332,7 +332,7 @@ final class PhabricatorDirectoryMainController
$phids = array_merge(
array($user_phid),
$revision_view->getRequiredHandlePHIDs());
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$revision_view->setHandles($handles);
@ -385,7 +385,7 @@ final class PhabricatorDirectoryMainController
array_filter(mpull($tasks, 'getOwnerPHID')),
array_mergev(mpull($tasks, 'getProjectPHIDs')));
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$view = new ManiphestTaskListView();
$view->setTasks($tasks);
@ -623,7 +623,7 @@ final class PhabricatorDirectoryMainController
$view->setUser($user);
$phids = $view->getRequiredHandlePHIDs();
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$view->setHandles($handles);
$panel = new AphrontPanelView();
@ -667,7 +667,7 @@ final class PhabricatorDirectoryMainController
$view->setUser($user);
$phids = $view->getRequiredHandlePHIDs();
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$view->setHandles($handles);
$panel = new AphrontPanelView();

View file

@ -34,7 +34,7 @@ final class DrydockLeaseListController extends DrydockController {
$data = $pager->sliceResults($data);
$phids = mpull($data, 'getOwnerPHID');
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$resource_ids = mpull($data, 'getResourceID');
$resources = array();

View file

@ -34,7 +34,7 @@ final class DrydockResourceListController extends DrydockController {
$data = $pager->sliceResults($data);
$phids = mpull($data, 'getOwnerPHID');
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$rows = array();
foreach ($data as $resource) {

View file

@ -209,7 +209,7 @@ final class PhabricatorFileListController extends PhabricatorFileController {
$this->setListPager($pager);
$phids = mpull($files, 'getAuthorPHID');
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$highlighted = $request->getStr('h');
$highlighted = explode('-', $highlighted);

View file

@ -57,8 +57,7 @@ final class PhabricatorFileMacroListController
"phid IN (%Ls)",
$file_phids);
$author_phids = mpull($files, 'getAuthorPHID', 'getPHID');
$handles = id(new PhabricatorObjectHandleData($author_phids))
->loadHandles();
$handles = $this->loadViewerHandles($author_phids);
}
$files_map = mpull($files, null, 'getPHID');

View file

@ -96,8 +96,7 @@ final class HeraldHomeController extends HeraldController {
$rules = $query->executeWithOffsetPager($pager);
$need_phids = mpull($rules, 'getAuthorPHID');
$handles = id(new PhabricatorObjectHandleData($need_phids))
->loadHandles();
$handles = $this->loadViewerHandles($need_phids);
$list_view = id(new HeraldRuleListView())
->setRules($rules)

View file

@ -474,7 +474,7 @@ final class HeraldRuleController extends HeraldController {
$phids[] = $rule->getAuthorPHID();
return id(new PhabricatorObjectHandleData($phids))->loadHandles();
return $this->loadViewerHandles($phids);
}

View file

@ -39,8 +39,7 @@ final class HeraldRuleEditHistoryController extends HeraldController {
$edits = $edit_query->executeWithOffsetPager($pager);
$need_phids = mpull($edits, 'getEditorPHID');
$handles = id(new PhabricatorObjectHandleData($need_phids))
->loadHandles();
$handles = $this->loadViewerHandles($need_phids);
$list_view = id(new HeraldRuleEditHistoryView())
->setEdits($edits)

View file

@ -61,8 +61,7 @@ final class HeraldTranscriptController extends HeraldController {
$phids = array_unique($phids);
$phids = array_filter($phids);
$handles = id(new PhabricatorObjectHandleData($phids))
->loadHandles();
$handles = $this->loadViewerHandles($phids);
$this->handles = $handles;
if ($xscript->getDryRun()) {
@ -473,8 +472,7 @@ final class HeraldTranscriptController extends HeraldController {
$data = array();
if ($object_xscript) {
$phid = $object_xscript->getPHID();
$handles = id(new PhabricatorObjectHandleData(array($phid)))
->loadHandles();
$handles = $this->loadViewerHandles(array($phid));
$data += array(
'Object Name' => $object_xscript->getName(),

View file

@ -63,8 +63,7 @@ final class HeraldTranscriptListController extends HeraldController {
$handles = array();
if ($data) {
$phids = ipull($data, 'objectPHID', 'objectPHID');
$handles = id(new PhabricatorObjectHandleData($phids))
->loadHandles();
$handles = $this->loadViewerHandles($phids);
}
$rows = array();

View file

@ -55,8 +55,7 @@ final class ManiphestBatchEditController extends ManiphestController {
$panel->setHeader('Maniphest Batch Editor');
$handle_phids = mpull($tasks, 'getOwnerPHID');
$handles = id(new PhabricatorObjectHandleData($handle_phids))
->loadHandles();
$handles = $this->loadViewerHandles($handle_phids);
$list = new ManiphestTaskListView();
$list->setTasks($tasks);

View file

@ -90,8 +90,7 @@ final class ManiphestExportController extends ManiphestController {
$tasks = array_mergev($tasks);
$all_projects = array_mergev(mpull($tasks, 'getProjectPHIDs'));
$project_handles = id(new PhabricatorObjectHandleData($all_projects))
->loadHandles();
$project_handles = $this->loadViewerHandles($all_projects);
$handles += $project_handles;
$workbook = new PHPExcel();

View file

@ -92,7 +92,7 @@ final class ManiphestReportController extends ManiphestController {
$project_phid = $request->getStr('project');
if ($project_phid) {
$phids = array($project_phid);
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$handle = $handles[$project_phid];
}
@ -403,7 +403,7 @@ final class ManiphestReportController extends ManiphestController {
$project_handle = null;
if ($project_phid) {
$phids = array($project_phid);
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$project_handle = $handles[$project_phid];
$query->withProjects($phids);
@ -475,7 +475,7 @@ final class ManiphestReportController extends ManiphestController {
}
$phids = array_keys($result);
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$handles = msort($handles, 'getName');
$order = $request->getStr('order', 'name');

View file

@ -61,7 +61,7 @@ final class ManiphestTaskDescriptionChangeController
$phids[$phid] = $phid;
}
}
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$engine = new PhabricatorMarkupEngine();
$engine->addObject($transaction, ManiphestTransaction::MARKUP_FIELD_BODY);

View file

@ -105,8 +105,7 @@ final class ManiphestTaskDetailController extends ManiphestController {
$phids = array_keys($phids);
$handles = id(new PhabricatorObjectHandleData($phids))
->loadHandles();
$handles = $this->loadViewerHandles($phids);
$dict = array();
$dict['Status'] =

View file

@ -318,8 +318,7 @@ final class ManiphestTaskEditController extends ManiphestController {
$phids = array_filter($phids);
$phids = array_unique($phids);
$handles = id(new PhabricatorObjectHandleData($phids))
->loadHandles();
$handles = $this->loadViewerHandles($phids);
$tvalues = mpull($handles, 'getFullName', 'getPHID');

View file

@ -113,8 +113,7 @@ final class ManiphestTransactionPreviewController extends ManiphestController {
}
$phids[] = $user->getPHID();
$handles = id(new PhabricatorObjectHandleData($phids))
->loadHandles();
$handles = $this->loadViewerHandles($phids);
$transactions = array();
$transactions[] = $transaction;

View file

@ -49,8 +49,7 @@ final class PhabricatorMetaMTAReceiveController
$received->processReceivedMail();
$phid = $receiver->getPHID();
$handles = id(new PhabricatorObjectHandleData(array($phid)))
->loadHandles();
$handles = $this->loadViewerHandles(array($phid));
$uri = $handles[$phid]->getURI();
return id(new AphrontRedirectResponse())->setURI($uri);

View file

@ -40,7 +40,7 @@ final class PhabricatorMetaMTAReceivedListController
);
$phids = array_unique(array_filter($phids));
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$rows = array();
foreach ($mails as $mail) {

View file

@ -59,9 +59,7 @@ final class PhabricatorOwnersDetailController
}
$phids = array_keys($phids);
$handles = id(new PhabricatorObjectHandleData($phids))
->setViewer($this->getRequest()->getUser())
->loadHandles();
$handles = $this->loadViewerHandles($phids);
$rows = array();
@ -216,9 +214,7 @@ final class PhabricatorOwnersDetailController
$phids[] = $commit_view['view']->getRequiredHandlePHIDs();
}
$phids = array_mergev($phids);
$handles = id(new PhabricatorObjectHandleData($phids))
->setViewer($user)
->loadHandles();
$handles = $this->loadViewerHandles($phids);
$commit_panels = array();
foreach ($commit_views as $commit_view) {

View file

@ -129,8 +129,7 @@ final class PhabricatorOwnersEditController
$error_view->setErrors($errors);
}
$handles = id(new PhabricatorObjectHandleData($owners))
->loadHandles();
$handles = $this->loadViewerHandles($owners);
$primary = $package->getPrimaryOwnerPHID();
if ($primary && isset($handles[$primary])) {

View file

@ -145,8 +145,7 @@ final class PhabricatorOwnersListController
if ($request->getArr('owner')) {
$phids = $request->getArr('owner');
$phid = reset($phids);
$handles = id(new PhabricatorObjectHandleData(array($phid)))
->loadHandles();
$handles = $this->loadViewerHandles(array($phid));
$owners_search_value = array(
$phid => $handles[$phid]->getFullName(),
);
@ -222,9 +221,7 @@ final class PhabricatorOwnersListController
$phids[$owner->getUserPHID()] = true;
}
$phids = array_keys($phids);
$handles = id(new PhabricatorObjectHandleData($phids))
->setViewer($this->getRequest()->getUser())
->loadHandles();
$handles = $this->loadViewerHandles($phids);
$repository_phids = array();
foreach ($paths as $path) {

View file

@ -39,7 +39,7 @@ final class PhabricatorPeopleLogsController
$phids = array_merge($filter_user, $filter_actor);
if ($phids) {
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
if ($filter_user) {
$filter_user = reset($filter_user);
$user_value = array(
@ -165,7 +165,7 @@ final class PhabricatorPeopleLogsController
$phids[$log->getUserPHID()] = true;
}
$phids = array_keys($phids);
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$rows = array();
foreach ($logs as $log) {

View file

@ -84,8 +84,7 @@ final class PhameBlogViewController
$blogger_phids = $this->getBloggerPHIDs();
if ($blogger_phids) {
$bloggers = id(new PhabricatorObjectHandleData($blogger_phids))
->loadHandles();
$bloggers = $this->loadViewerHandles($blogger_phids);
} else {
$bloggers = array();
}

View file

@ -67,7 +67,7 @@ abstract class PhamePostListBaseController
$blogger_phids = mpull($posts, 'getBloggerPHID', 'getBloggerPHID');
return
id(new PhabricatorObjectHandleData($blogger_phids))->loadHandles();
$this->loadViewerHandles($blogger_phids);
}
protected function buildPostListPageResponse() {

View file

@ -24,8 +24,7 @@ final class PhabricatorPHIDLookupController
$request = $this->getRequest();
$phids = $request->getStrList('phids');
if ($phids) {
$handles = id(new PhabricatorObjectHandleData($phids))
->loadHandles();
$handles = $this->loadViewerHandles($phids);
$rows = array();
foreach ($handles as $handle) {

View file

@ -238,7 +238,7 @@ final class PhrictionDiffController
$user = $this->getRequest()->getUser();
$phids = mpull($content, 'getAuthorPHID');
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$rows = array();
foreach ($content as $c) {

View file

@ -125,7 +125,7 @@ final class PhrictionDocumentController
$content->getAuthorPHID(),
$project_phid,
));
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$age = time() - $content->getDateCreated();
$age = floor($age / (60 * 60 * 24));
@ -234,8 +234,7 @@ final class PhrictionDocumentController
$ancestor_phids = mpull($ancestors, 'getPHID');
$handles = array();
if ($ancestor_phids) {
$handles = id(new PhabricatorObjectHandleData($ancestor_phids))
->loadHandles();
$handles = $this->loadViewerHandles($ancestor_phids);
}
$ancestor_handles = array();

View file

@ -55,8 +55,7 @@ final class PhrictionHistoryController
$history = $pager->sliceResults($history);
$author_phids = mpull($history, 'getAuthorPHID');
$handles = id(new PhabricatorObjectHandleData($author_phids))
->loadHandles();
$handles = $this->loadViewerHandles($author_phids);
$rows = array();
foreach ($history as $content) {

View file

@ -65,7 +65,7 @@ final class PhrictionListController
$content = mpull($documents, 'getContent');
$phids = mpull($content, 'getAuthorPHID');
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$rows = array();

View file

@ -32,8 +32,7 @@ final class PonderAnswerPreviewController
$author_phid = $user->getPHID();
$object_phids = array($author_phid);
$handles = id(new PhabricatorObjectHandleData($object_phids))
->loadHandles();
$handles = $this->loadViewerHandles($object_phids);
$answer = new PonderAnswer();
$answer->setContent($request->getStr('content'));

View file

@ -86,8 +86,7 @@ final class PonderFeedController extends PonderController {
foreach ($data as $question) {
$phids[] = $question->getAuthorPHID();
}
$handles = id(new PhabricatorObjectHandleData($phids))
->loadHandles();
$handles = $this->loadViewerHandles($phids);
$side_nav->appendChild(
id(new PonderQuestionFeedView())
@ -115,8 +114,7 @@ final class PonderFeedController extends PonderController {
);
$phids = array($user->getPHID());
$handles = id(new PhabricatorObjectHandleData($phids))
->loadHandles();
$handles = $this->loadViewerHandles($phids);
$side_nav->appendChild(
id(new PonderUserProfileView())

View file

@ -29,8 +29,7 @@ final class PonderQuestionPreviewController
$author_phid = $user->getPHID();
$object_phids = array($author_phid);
$handles = id(new PhabricatorObjectHandleData($object_phids))
->loadHandles();
$handles = $this->loadViewerHandles($object_phids);
$question = new PonderQuestion();
$question->setContent($request->getStr('content'));

View file

@ -41,8 +41,7 @@ final class PonderQuestionViewController extends PonderController {
$object_phids[] = $answer->getAuthorPHID();
}
$handles = id(new PhabricatorObjectHandleData($object_phids))
->loadHandles();
$handles = $this->loadViewerHandles($object_phids);
$detail_panel = new PonderQuestionDetailView();
$detail_panel

View file

@ -87,8 +87,7 @@ final class PhabricatorProjectMembersEditController
}
$member_phids = array_reverse($member_phids);
$handles = id(new PhabricatorObjectHandleData($member_phids))
->loadHandles();
$handles = $this->loadViewerHandles($member_phids);
$state = array();
foreach ($handles as $handle) {

View file

@ -149,8 +149,7 @@ final class PhabricatorProjectProfileController
$phids = array($project->getAuthorPHID());
$phids = array_unique($phids);
$handles = id(new PhabricatorObjectHandleData($phids))
->loadHandles();
$handles = $this->loadViewerHandles($phids);
$timestamp = phabricator_datetime($project->getDateCreated(), $viewer);
@ -187,8 +186,7 @@ final class PhabricatorProjectProfileController
PhabricatorProjectProfile $profile) {
$member_phids = $project->getMemberPHIDs();
$handles = id(new PhabricatorObjectHandleData($member_phids))
->loadHandles();
$handles = $this->loadViewerHandles($member_phids);
$affiliated = array();
foreach ($handles as $phids => $handle) {
@ -259,8 +257,7 @@ final class PhabricatorProjectProfileController
$phids = mpull($tasks, 'getOwnerPHID');
$phids = array_filter($phids);
$handles = id(new PhabricatorObjectHandleData($phids))
->loadHandles();
$handles = $this->loadViewerHandles($phids);
$task_views = array();
foreach ($tasks as $task) {

View file

@ -109,8 +109,7 @@ final class PhabricatorSearchAttachController
$strings = $this->getStrings();
$handles = id(new PhabricatorObjectHandleData($phids))
->loadHandles();
$handles = $this->loadViewerHandles($phids);
$obj_dialog = new PhabricatorObjectSelectorDialog();
$obj_dialog
@ -279,8 +278,7 @@ final class PhabricatorSearchAttachController
private function raiseGraphCycleException(PhabricatorEdgeCycleException $ex) {
$cycle = $ex->getCycle();
$handles = id(new PhabricatorObjectHandleData($cycle))
->loadHandles();
$handles = $this->loadViewerHandles($cycle);
$names = array();
foreach ($cycle as $cycle_phid) {
$names[] = $handles[$cycle_phid]->getFullName();

View file

@ -128,8 +128,7 @@ final class PhabricatorSearchController
$query->getParameter('project', array())
);
$handles = id(new PhabricatorObjectHandleData($phids))
->loadHandles();
$handles = $this->loadViewerHandles($phids);
$author_value = array_select_keys(
$handles,

View file

@ -103,7 +103,7 @@ final class PhabricatorSearchIndexController
$relationships = $document->getRelationshipData();
$phids = ipull($relationships, 1);
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$rows = array();
foreach ($relationships as $relationship) {

View file

@ -64,8 +64,7 @@ final class PhabricatorSearchSelectController
$phids += $this->queryObjectNames($query_str);
$phids = array_keys($phids);
$handles = id(new PhabricatorObjectHandleData($phids))
->loadHandles();
$handles = $this->loadViewerHandles($phids);
$data = array();
foreach ($handles as $handle) {

View file

@ -56,7 +56,7 @@ final class PhabricatorSlowvoteListController
$polls = $this->loadPolls($pager, $view);
$phids = mpull($polls, 'getAuthorPHID');
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
$rows = array();
foreach ($polls as $poll) {

View file

@ -170,7 +170,7 @@ final class PhabricatorTypeaheadCommonDatasourceController
if ($need_rich_data) {
$phids = mpull($users, 'getPHID');
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$handles = $this->loadViewerHandles($phids);
}
foreach ($users as $user) {

View file

@ -226,8 +226,7 @@ abstract class PhabricatorInlineCommentController
$phids = array($user->getPHID());
$handles = id(new PhabricatorObjectHandleData($phids))
->loadHandles();
$handles = $this->loadViewerHandles($phids);
$view = new DifferentialInlineCommentView();
$view->setInlineComment($inline);

View file

@ -30,8 +30,7 @@ abstract class PhabricatorInlineCommentPreviewController
$engine = PhabricatorMarkupEngine::newDifferentialMarkupEngine();
$phids = array($user->getPHID());
$handles = id(new PhabricatorObjectHandleData($phids))
->loadHandles();
$handles = $this->loadViewerHandles($phids);
$views = array();
foreach ($inlines as $inline) {