Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F679792
HarbormasterQueryBuildsConduitAPIMethod.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
HarbormasterQueryBuildsConduitAPIMethod.php
View Options
<?php
final
class
HarbormasterQueryBuildsConduitAPIMethod
extends
HarbormasterConduitAPIMethod
{
public
function
getAPIMethodName
()
{
return
'harbormaster.querybuilds'
;
}
public
function
getMethodDescription
()
{
return
pht
(
'Query Harbormaster builds.'
);
}
public
function
getMethodStatus
()
{
return
self
::
METHOD_STATUS_DEPRECATED
;
}
public
function
getMethodStatusDescription
()
{
return
pht
(
'Use %s instead.'
,
'harbormaster.build.search'
);
}
protected
function
defineParamTypes
()
{
return
array
(
'ids'
=>
'optional list<id>'
,
'phids'
=>
'optional list<phid>'
,
'buildStatuses'
=>
'optional list<string>'
,
'buildablePHIDs'
=>
'optional list<phid>'
,
'buildPlanPHIDs'
=>
'optional list<phid>'
,
)
+
self
::
getPagerParamTypes
();
}
protected
function
defineReturnType
()
{
return
'wild'
;
}
protected
function
execute
(
ConduitAPIRequest
$request
)
{
$viewer
=
$request
->
getUser
();
$call
=
new
ConduitCall
(
'harbormaster.build.search'
,
array_filter
(
array
(
'constraints'
=>
array_filter
(
array
(
'ids'
=>
$request
->
getValue
(
'ids'
),
'phids'
=>
$request
->
getValue
(
'phids'
),
'statuses'
=>
$request
->
getValue
(
'buildStatuses'
),
'buildables'
=>
$request
->
getValue
(
'buildablePHIDs'
),
'plans'
=>
$request
->
getValue
(
'buildPlanPHIDs'
),
)),
'attachments'
=>
array
(
'querybuilds'
=>
true
,
),
'limit'
=>
$request
->
getValue
(
'limit'
),
'before'
=>
$request
->
getValue
(
'before'
),
'after'
=>
$request
->
getValue
(
'after'
),
)));
$subsumption
=
$call
->
setUser
(
$viewer
)
->
execute
();
$data
=
array
();
foreach
(
$subsumption
[
'data'
]
as
$build_data
)
{
$querybuilds
=
idxv
(
$build_data
,
array
(
'attachments'
,
'querybuilds'
),
array
());
$fields
=
idx
(
$build_data
,
'fields'
,
array
());
unset
(
$build_data
[
'fields'
]);
unset
(
$build_data
[
'attachments'
]);
// To retain backward compatibility, remove newer keys from the
// result array.
$fields
[
'buildStatus'
]
=
array_select_keys
(
$fields
[
'buildStatus'
],
array
(
'value'
,
'name'
,
));
$data
[]
=
array_mergev
(
array
(
$build_data
,
$querybuilds
,
$fields
));
}
$subsumption
[
'data'
]
=
$data
;
return
$subsumption
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, May 27, 8:47 AM (1 d, 11 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
164561
Default Alt Text
HarbormasterQueryBuildsConduitAPIMethod.php (2 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment