Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F111516076
ReleephGetBranchesConduitAPIMethod.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
Fri, May 2, 21:08
Size
1 KB
Mime Type
text/x-php
Expires
Sun, May 4, 21:08 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
25917696
Attached To
rPH Phabricator
ReleephGetBranchesConduitAPIMethod.php
View Options
<?php
final
class
ReleephGetBranchesConduitAPIMethod
extends
ReleephConduitAPIMethod
{
public
function
getAPIMethodName
()
{
return
'releeph.getbranches'
;
}
public
function
getMethodDescription
()
{
return
'Return information about all active Releeph branches.'
;
}
public
function
defineParamTypes
()
{
return
array
(
);
}
public
function
defineReturnType
()
{
return
'nonempty list<dict<string, wild>>'
;
}
public
function
defineErrorTypes
()
{
return
array
(
);
}
protected
function
execute
(
ConduitAPIRequest
$request
)
{
$results
=
array
();
$projects
=
id
(
new
ReleephProductQuery
())
->
setViewer
(
$request
->
getUser
())
->
withActive
(
1
)
->
execute
();
foreach
(
$projects
as
$project
)
{
$repository
=
$project
->
getRepository
();
$branches
=
$project
->
loadRelatives
(
id
(
new
ReleephBranch
()),
'releephProjectID'
,
'getID'
,
'isActive = 1'
);
foreach
(
$branches
as
$branch
)
{
$full_branch_name
=
$branch
->
getName
();
$cut_point_commit
=
$branch
->
loadOneRelative
(
id
(
new
PhabricatorRepositoryCommit
()),
'phid'
,
'getCutPointCommitPHID'
);
$results
[]
=
array
(
'project'
=>
$project
->
getName
(),
'repository'
=>
$repository
->
getCallsign
(),
'branch'
=>
$branch
->
getBasename
(),
'fullBranchName'
=>
$full_branch_name
,
'symbolicName'
=>
$branch
->
getSymbolicName
(),
'cutPoint'
=>
$cut_point_commit
->
getCommitIdentifier
(),
);
}
}
return
$results
;
}
}
Event Timeline
Log In to Comment