Page MenuHomePhorge

PhabricatorUserTitleField.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

PhabricatorUserTitleField.php

<?php
final class PhabricatorUserTitleField
extends PhabricatorUserCustomField {
private $value;
public function getFieldKey() {
return 'user:title';
}
public function getFieldName() {
return pht('Title');
}
public function getFieldDescription() {
return pht('User title, like "CEO" or "Assistant to the Manager".');
}
protected function didSetObject(PhabricatorCustomFieldInterface $object) {
$this->value = $object->loadUserProfile()->getTitle();
}
public function getOldValueForApplicationTransactions() {
return $this->getObject()->loadUserProfile()->getTitle();
}
public function getNewValueForApplicationTransactions() {
return $this->value;
}
public function applyApplicationTransactionInternalEffects(
PhabricatorApplicationTransaction $xaction) {
$this->getObject()->loadUserProfile()->setTitle($xaction->getNewValue());
}
public function setValueFromRequest(AphrontRequest $request) {
$this->value = $request->getStr($this->getFieldKey());
}
public function renderEditControl() {
return id(new AphrontFormTextControl())
->setName($this->getFieldKey())
->setValue($this->value)
->setLabel($this->getFieldName())
->setCaption(pht('Serious business title.'));
}
}

File Metadata

Mime Type
text/x-php
Expires
Sun, May 4, 8:54 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
67813
Default Alt Text
PhabricatorUserTitleField.php (1 KB)

Event Timeline