1<?php
2
3final class ArcanistTaskRef
4  extends ArcanistRef {
5
6  private $parameters;
7
8  public function getRefDisplayName() {
9    return pht('Task "%s"', $this->getMonogram());
10  }
11
12  public static function newFromConduit(array $parameters) {
13    $ref = new self();
14    $ref->parameters = $parameters;
15    return $ref;
16  }
17
18  public function getID() {
19    return idx($this->parameters, 'id');
20  }
21
22  public function getPHID() {
23    return idx($this->parameters, 'phid');
24  }
25
26  public function getName() {
27    return idxv($this->parameters, array('fields', 'name'));
28  }
29
30  public function getMonogram() {
31    return 'T'.$this->getID();
32  }
33
34  protected function buildRefView(ArcanistRefView $view) {
35    $view
36      ->setObjectName($this->getMonogram())
37      ->setTitle($this->getName());
38  }
39
40}
41