Path: blob/master/src/applications/differential/customfield/DifferentialCustomField.php
12256 views
<?php12/**3* @task commitmessage Integration with Commit Messages4* @task diff Integration with Diff Properties5*/6abstract class DifferentialCustomField7extends PhabricatorCustomField {89/**10* TODO: It would be nice to remove this, but a lot of different code is11* bound together by it. Until everything is modernized, retaining the old12* field keys is the only reasonable way to update things one piece13* at a time.14*/15public function getFieldKeyForConduit() {16return $this->getFieldKey();17}1819// TODO: As above.20public function getModernFieldKey() {21return $this->getFieldKeyForConduit();22}2324protected function parseObjectList(25$value,26array $types,27$allow_partial = false,28array $suffixes = array()) {29return id(new PhabricatorObjectListQuery())30->setViewer($this->getViewer())31->setAllowedTypes($types)32->setObjectList($value)33->setAllowPartialResults($allow_partial)34->setSuffixes($suffixes)35->execute();36}3738protected function renderObjectList(39array $handles,40array $suffixes = array()) {4142if (!$handles) {43return null;44}4546$out = array();47foreach ($handles as $handle) {48$phid = $handle->getPHID();4950if ($handle->getPolicyFiltered()) {51$token = $phid;52} else if ($handle->isComplete()) {53$token = $handle->getCommandLineObjectName();54}5556$suffix = idx($suffixes, $phid);57$token = $token.$suffix;5859$out[] = $token;60}6162return implode(', ', $out);63}6465public function getWarningsForDetailView() {66if ($this->getProxy()) {67return $this->getProxy()->getWarningsForDetailView();68}69return array();70}7172protected function getActiveDiff() {73$object = $this->getObject();74try {75return $object->getActiveDiff();76} catch (Exception $ex) {77return null;78}79}8081public function getRequiredHandlePHIDsForRevisionHeaderWarnings() {82return array();83}8485public function getWarningsForRevisionHeader(array $handles) {86return array();87}888990/* -( Integration with Commit Messages )----------------------------------- */919293/**94* @task commitmessage95*/96public function getProTips() {97if ($this->getProxy()) {98return $this->getProxy()->getProTips();99}100return array();101}102103104/* -( Integration with Diff Properties )----------------------------------- */105106107/**108* @task diff109*/110public function shouldAppearInDiffPropertyView() {111if ($this->getProxy()) {112return $this->getProxy()->shouldAppearInDiffPropertyView();113}114return false;115}116117118/**119* @task diff120*/121public function renderDiffPropertyViewLabel(DifferentialDiff $diff) {122if ($this->getProxy()) {123return $this->getProxy()->renderDiffPropertyViewLabel($diff);124}125return $this->getFieldName();126}127128129/**130* @task diff131*/132public function renderDiffPropertyViewValue(DifferentialDiff $diff) {133if ($this->getProxy()) {134return $this->getProxy()->renderDiffPropertyViewValue($diff);135}136throw new PhabricatorCustomFieldImplementationIncompleteException($this);137}138139}140141142