Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F21590023
ArcanistUserRef.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
ArcanistUserRef.php
View Options
<?php
final
class
ArcanistUserRef
extends
ArcanistRef
implements
ArcanistDisplayRefInterface
{
private
$parameters
;
public
function
getRefDisplayName
()
{
return
pht
(
'User "%s"'
,
$this
->
getMonogram
());
}
public
static
function
newFromConduit
(
array
$parameters
)
{
$ref
=
new
self
();
$ref
->
parameters
=
$parameters
;
return
$ref
;
}
public
static
function
newFromConduitWhoami
(
array
$parameters
)
{
// NOTE: The "user.whoami" call returns a different structure than
// "user.search". Mangle the data so it looks similar.
$parameters
[
'fields'
]
=
array
(
'username'
=>
idx
(
$parameters
,
'userName'
),
'realName'
=>
idx
(
$parameters
,
'realName'
),
);
return
self
::
newFromConduit
(
$parameters
);
}
public
function
getID
()
{
return
idx
(
$this
->
parameters
,
'id'
);
}
public
function
getPHID
()
{
return
idx
(
$this
->
parameters
,
'phid'
);
}
public
function
getMonogram
()
{
return
'@'
.
$this
->
getUsername
();
}
public
function
getUsername
()
{
return
idxv
(
$this
->
parameters
,
array
(
'fields'
,
'username'
));
}
public
function
getRealName
()
{
return
idxv
(
$this
->
parameters
,
array
(
'fields'
,
'realName'
));
}
public
function
getDisplayRefObjectName
()
{
return
$this
->
getMonogram
();
}
public
function
getDisplayRefTitle
()
{
$real_name
=
$this
->
getRealName
();
if
(
strlen
(
$real_name
))
{
$real_name
=
sprintf
(
'(%s)'
,
$real_name
);
}
return
$real_name
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Nov 9, 13:43 (4 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1182215
Default Alt Text
ArcanistUserRef.php (1 KB)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline