Skip to content

Commit 2210a0c

Browse files
committed
Merge pull request GitLabPHP#51 from nerdhive/master
Added labels to Issue model and API
2 parents 4168b2d + f33dc47 commit 2210a0c

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

lib/Gitlab/Api/Issues.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@
44

55
class Issues extends AbstractApi
66
{
7-
public function all($project_id = null, $page = 1, $per_page = self::PER_PAGE)
7+
public function all($project_id = null, $page = 1, $per_page = self::PER_PAGE, array $params = array())
88
{
99
$path = $project_id === null ? 'issues' : 'projects/'.urlencode($project_id).'/issues';
1010

11-
return $this->get($path, array(
11+
$params = array_intersect_key($params, array('labels' => '', 'state' => ''));
12+
$params = array_merge(array(
1213
'page' => $page,
1314
'per_page' => $per_page
14-
));
15+
), $params);
16+
17+
return $this->get($path, $params);
1518
}
1619

1720
public function show($project_id, $issue_id)

lib/Gitlab/Model/Issue.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ class Issue extends AbstractModel
2020
'updated_at',
2121
'created_at',
2222
'project',
23-
'state'
23+
'state',
24+
'labels'
2425
);
2526

2627
public static function fromArray(Client $client, Project $project, array $data)

0 commit comments

Comments
 (0)