Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F456830
PhabricatorUserRealNameField.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
PhabricatorUserRealNameField.php
View Options
<?php
final
class
PhabricatorUserRealNameField
extends
PhabricatorUserCustomField
{
private
$value
;
public
function
getFieldKey
()
{
return
'user:realname'
;
}
public
function
getFieldName
()
{
return
pht
(
'Real Name'
);
}
public
function
getFieldDescription
()
{
return
pht
(
'Stores the real name of the user, like "Abraham Lincoln".'
);
}
protected
function
didSetObject
(
PhabricatorCustomFieldInterface
$object
)
{
$this
->
value
=
$object
->
getRealName
();
}
public
function
getOldValueForApplicationTransactions
()
{
return
$this
->
getObject
()->
getRealName
();
}
public
function
getNewValueForApplicationTransactions
()
{
if
(!
$this
->
isEditable
())
{
return
$this
->
getObject
()->
getRealName
();
}
return
$this
->
value
;
}
public
function
applyApplicationTransactionInternalEffects
(
PhabricatorApplicationTransaction
$xaction
)
{
$this
->
getObject
()->
setRealName
(
$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
())
->
setDisabled
(!
$this
->
isEditable
());
}
private
function
isEditable
()
{
return
PhabricatorEnv
::
getEnvConfig
(
'account.editable'
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 5, 8:49 AM (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
70528
Default Alt Text
PhabricatorUserRealNameField.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment