Page MenuHomePhabricator
Paste P2022

ShowRepositoryInRevisionList.php
ActivePublic

Authored by avivey on Dec 7 2016, 12:45 AM.
<?php
final class ShowRepositoryInRevisionList
extends DifferentialCustomField {
private $value;
public function getFieldKey() {
return 'hack:repo';
}
public function readValueFromObject(
PhabricatorCustomFieldInterface $revision) {
$this->value = $revision->getRepositoryPHID();
}
public function shouldAppearInListView() {
return true;
}
public function renderOnListItem(
PHUIObjectItemView $view) {
if ($this->value) {
$view->addAttribute($this->getViewer()->renderHandle($this->value));
}
}
}