Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F450666
PhabricatorUserTitleField.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorUserTitleField.php
View Options
<?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
Details
Attached
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)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment