1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-27 05:59:08 +01:00
phorge-phorge/src/applications/people/customfield/PhabricatorUserBlurbField.php

49 lines
1.2 KiB
PHP
Raw Normal View History

<?php
final class PhabricatorUserBlurbField
extends PhabricatorUserCustomField {
private $value;
public function getFieldKey() {
return 'user:blurb';
}
public function getFieldName() {
return pht('Blurb');
}
public function getFieldDescription() {
return pht('Short user summary.');
}
protected function didSetObject(PhabricatorCustomFieldInterface $object) {
$this->value = $object->loadUserProfile()->getBlurb();
}
public function getOldValueForApplicationTransactions() {
return $this->getObject()->loadUserProfile()->getBlurb();
}
public function getNewValueForApplicationTransactions() {
return $this->value;
}
public function applyApplicationTransactionInternalEffects(
PhabricatorApplicationTransaction $xaction) {
$this->getObject()->loadUserProfile()->setBlurb($xaction->getNewValue());
}
public function setValueFromRequest(AphrontRequest $request) {
$this->value = $request->getStr($this->getFieldKey());
}
public function renderEditControl() {
return id(new PhabricatorRemarkupControl())
->setName($this->getFieldKey())
->setValue($this->value)
->setLabel($this->getFieldName());
}
}