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