Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F2117404
DifferentialGetDiffPropertiesConduitAPIMethod.php
mwek (Maciek Weksej)
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
mwek
Dec 13 2016, 9:26 PM
2016-12-13 21:26:26 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
DifferentialGetDiffPropertiesConduitAPIMethod.php
View Options
<?php
final
class
DifferentialGetDiffPropertiesConduitAPIMethod
extends
DifferentialConduitAPIMethod
{
public
function
getAPIMethodName
()
{
return
'differential.getdiffproperties'
;
}
public
function
getMethodDescription
()
{
return
pht
(
'Read properties from Differential diffs.'
);
}
protected
function
defineParamTypes
()
{
return
array
(
'diff_id'
=>
'required diff_id'
,
'names'
=>
'optional list<string>'
,
);
}
protected
function
defineReturnType
()
{
return
'dict'
;
}
protected
function
defineErrorTypes
()
{
return
array
(
'ERR_NOT_FOUND'
=>
pht
(
'Properties not found.'
),
);
}
protected
function
execute
(
ConduitAPIRequest
$request
)
{
$diff_id
=
$request
->
getValue
(
'diff_id'
);
$names
=
$request
->
getValue
(
'names'
,
array
());
$properties
=
array
();
if
(
$names
)
{
$properties
=
id
(
new
DifferentialDiffProperty
())->
loadAllWhere
(
'diffID = %d AND name IN (%Ls)'
,
$diff_id
,
$names
);
}
else
{
$properties
=
id
(
new
DifferentialDiffProperty
())->
loadAllWhere
(
'diffID = %d'
,
$diff_id
);
}
if
(!
$properties
)
{
throw
new
ConduitException
(
'ERR_NOT_FOUND'
);
}
return
mpull
(
$properties
,
'getData'
,
'getName'
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
371129
Default Alt Text
DifferentialGetDiffPropertiesConduitAPIMethod.php (1 KB)
Attached To
Mode
T12011: Support builds with Travis CI
Attached
Detach File
Event Timeline
Log In to Comment