Path: blob/master/src/applications/people/customfield/PhabricatorUserIconField.php
12256 views
<?php12final class PhabricatorUserIconField3extends PhabricatorUserCustomField {45private $value;67public function getFieldKey() {8return 'user:icon';9}1011public function getModernFieldKey() {12return 'icon';13}1415public function getFieldKeyForConduit() {16return $this->getModernFieldKey();17}1819public function getFieldName() {20return pht('Icon');21}2223public function getFieldDescription() {24return pht('User icon to accompany their title.');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()->getIcon();41}4243public function getOldValueForApplicationTransactions() {44return $this->getObject()->loadUserProfile()->getIcon();45}4647public function getNewValueForApplicationTransactions() {48return $this->value;49}5051public function applyApplicationTransactionInternalEffects(52PhabricatorApplicationTransaction $xaction) {53$this->getObject()->loadUserProfile()->setIcon($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 PHUIFormIconSetControl())67->setName($this->getFieldKey())68->setValue($this->value)69->setLabel($this->getFieldName())70->setIconSet(new PhabricatorPeopleIconSet());71}7273public function shouldAppearInConduitTransactions() {74return true;75}7677protected function newConduitEditParameterType() {78return new ConduitStringParameterType();79}8081}828384