Path: blob/master/src/applications/people/customfield/PhabricatorUserBlurbField.php
12256 views
<?php12final class PhabricatorUserBlurbField3extends PhabricatorUserCustomField {45private $value;67public function getFieldKey() {8return 'user:blurb';9}1011public function getModernFieldKey() {12return 'blurb';13}1415public function getFieldKeyForConduit() {16return $this->getModernFieldKey();17}1819public function getFieldName() {20return pht('Blurb');21}2223public function getFieldDescription() {24return pht('Short blurb about the user.');25}2627public function shouldAppearInApplicationTransactions() {28return true;29}3031public function shouldAppearInEditView() {32return true;33}3435public function shouldAppearInPropertyView() {36return true;37}3839public function readValueFromObject(PhabricatorCustomFieldInterface $object) {40$this->value = $object->loadUserProfile()->getBlurb();41}4243public function getOldValueForApplicationTransactions() {44return $this->getObject()->loadUserProfile()->getBlurb();45}4647public function getNewValueForApplicationTransactions() {48return $this->value;49}5051public function applyApplicationTransactionInternalEffects(52PhabricatorApplicationTransaction $xaction) {53$this->getObject()->loadUserProfile()->setBlurb($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 PhabricatorRemarkupControl())67->setUser($this->getViewer())68->setName($this->getFieldKey())69->setValue($this->value)70->setLabel($this->getFieldName());71}7273public function getApplicationTransactionRemarkupBlocks(74PhabricatorApplicationTransaction $xaction) {75return array(76$xaction->getNewValue(),77);78}7980public function renderPropertyViewLabel() {81return null;82}8384public function renderPropertyViewValue(array $handles) {85$blurb = $this->getObject()->loadUserProfile()->getBlurb();86if (!strlen($blurb)) {87return null;88}8990$viewer = $this->getViewer();91$view = new PHUIRemarkupView($viewer, $blurb);9293return $view;94}9596public function getStyleForPropertyView() {97return 'block';98}99100public function shouldAppearInConduitTransactions() {101return true;102}103104protected function newConduitEditParameterType() {105return new ConduitStringParameterType();106}107108}109110111