Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F108294418
ConduitAPI_phid_lookup_Method.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Apr 15, 14:22
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Apr 17, 14:22 (2 d)
Engine
blob
Format
Raw Data
Handle
25528254
Attached To
rPH Phabricator
ConduitAPI_phid_lookup_Method.php
View Options
<?php
/**
* @group conduit
*/
final
class
ConduitAPI_phid_lookup_Method
extends
ConduitAPI_phid_Method
{
public
function
getMethodDescription
()
{
return
"Look up objects by name."
;
}
public
function
defineParamTypes
()
{
return
array
(
'names'
=>
'required list<string>'
,
);
}
public
function
defineReturnType
()
{
return
'nonempty dict<string, wild>'
;
}
public
function
defineErrorTypes
()
{
return
array
();
}
protected
function
execute
(
ConduitAPIRequest
$request
)
{
$names
=
$request
->
getValue
(
'names'
);
$phids
=
array
();
foreach
(
$names
as
$name
)
{
$phid
=
PhabricatorPHID
::
fromObjectName
(
$name
);
if
(
$phid
)
{
$phids
[
$name
]
=
$phid
;
}
}
$handles
=
id
(
new
PhabricatorObjectHandleData
(
$phids
))
->
loadHandles
();
$result
=
array
();
foreach
(
$phids
as
$name
=>
$phid
)
{
if
(
isset
(
$handles
[
$phid
])
&&
$handles
[
$phid
]->
isComplete
())
{
$result
[
$name
]
=
$this
->
buildHandleInformationDictionary
(
$handles
[
$phid
]);
}
}
return
$result
;
}
}
Event Timeline
Log In to Comment