Path: blob/master/src/applications/people/customfield/PhabricatorUserTitleField.php
12256 views
<?php12final class PhabricatorUserTitleField3extends PhabricatorUserCustomField {45private $value;67public function getFieldKey() {8return 'user:title';9}1011public function getModernFieldKey() {12return 'title';13}1415public function getFieldKeyForConduit() {16return $this->getModernFieldKey();17}1819public function getFieldName() {20return pht('Title');21}2223public function getFieldDescription() {24return pht('User title, like "CEO" or "Assistant to the Manager".');25}2627public function canDisableField() {28return false;29}3031public function shouldAppearInApplicationTransactions() {32return true;33}3435public function shouldAppearInEditView() {36return true;37}3839public function readValueFromObject(PhabricatorCustomFieldInterface $object) {40$this->value = $object->loadUserProfile()->getTitle();41}4243public function getOldValueForApplicationTransactions() {44return $this->getObject()->loadUserProfile()->getTitle();45}4647public function getNewValueForApplicationTransactions() {48return $this->value;49}5051public function applyApplicationTransactionInternalEffects(52PhabricatorApplicationTransaction $xaction) {53$this->getObject()->loadUserProfile()->setTitle($xaction->getNewValue());54}5556public function readValueFromRequest(AphrontRequest $request) {57$this->value = $request->getStr($this->getFieldKey());58}5960public function setValueFromStorage($value) {61$this->value = $value;62return $this;63}6465public function renderEditControl(array $handles) {66return id(new AphrontFormTextControl())67->setName($this->getFieldKey())68->setValue($this->value)69->setLabel($this->getFieldName());70}7172public function shouldAppearInConduitTransactions() {73return true;74}7576protected function newConduitEditParameterType() {77return new ConduitStringParameterType();78}7980}818283