From 2056fc52ff2e6aeade6443c0761d0e76c9e4a560 Mon Sep 17 00:00:00 2001 From: dingguodong Date: Fri, 20 Aug 2021 15:13:30 +0800 Subject: [PATCH] + Add getBranches functions. --- module/gitlab/model.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/module/gitlab/model.php b/module/gitlab/model.php index 3ad8662b2e..0320cd7472 100644 --- a/module/gitlab/model.php +++ b/module/gitlab/model.php @@ -306,6 +306,26 @@ class gitlabModel extends model return $refList; } + /** + * Get branches. + * + * @param int $gitlabID + * @param int $projectID + * @access public + * @return array + */ + public function getBranches($gitlabID, $projectID) + { + $rawBranches = $this->apiGetBranches($gitlabID, $projectID); + + $branches = array(); + foreach($rawBranches as $branch) + { + $branches[] = $branch->name; + } + return $branches; + } + /** * Create a gitlab. *