Path: blob/master/src/applications/differential/customfield/DifferentialBlameRevisionField.php
12256 views
<?php12final class DifferentialBlameRevisionField3extends DifferentialStoredCustomField {45public function getFieldKey() {6return 'phabricator:blame-revision';7}89public function getFieldKeyForConduit() {10return 'blameRevision';11}1213public function getFieldName() {14return pht('Blame Revision');15}1617public function getFieldDescription() {18return pht('Stores a reference to what this fixes.');19}2021public function shouldDisableByDefault() {22return true;23}2425public function shouldAppearInPropertyView() {26return true;27}2829public function renderPropertyViewLabel() {30return $this->getFieldName();31}3233public function renderPropertyViewValue(array $handles) {34if (!strlen($this->getValue())) {35return null;36}3738return $this->getValue();39}4041public function shouldAppearInEditView() {42return true;43}4445public function shouldAppearInApplicationTransactions() {46return true;47}4849public function getOldValueForApplicationTransactions() {50return $this->getValue();51}5253public function getNewValueForApplicationTransactions() {54return $this->getValue();55}5657public function readValueFromRequest(AphrontRequest $request) {58$this->setValue($request->getStr($this->getFieldKey()));59}6061public function renderEditControl(array $handles) {62return id(new AphrontFormTextControl())63->setName($this->getFieldKey())64->setValue($this->getValue())65->setLabel($this->getFieldName());66}6768public function getApplicationTransactionTitle(69PhabricatorApplicationTransaction $xaction) {70$author_phid = $xaction->getAuthorPHID();71$old = $xaction->getOldValue();72$new = $xaction->getNewValue();7374return pht(75'%s updated the blame revision for this revision.',76$xaction->renderHandleLink($author_phid));77}7879public function getApplicationTransactionTitleForFeed(80PhabricatorApplicationTransaction $xaction) {8182$object_phid = $xaction->getObjectPHID();83$author_phid = $xaction->getAuthorPHID();84$old = $xaction->getOldValue();85$new = $xaction->getNewValue();8687return pht(88'%s updated the blame revision for %s.',89$xaction->renderHandleLink($author_phid),90$xaction->renderHandleLink($object_phid));91}9293public function shouldAppearInConduitDictionary() {94return true;95}9697public function shouldAppearInConduitTransactions() {98return true;99}100101protected function newConduitEditParameterType() {102return new ConduitStringParameterType();103}104105}106107108