Skip to content

Commit bde452a

Browse files
committed
Merge pull request #69 from mrkrstphr/org-issues
Implementing handling organization issues
2 parents 8a8f304 + 930abe6 commit bde452a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

lib/Github/Api/Issue.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,24 @@ public function find($username, $repository, $state, $keyword)
5151
return $this->get('legacy/issues/search/'.urlencode($username).'/'.urlencode($repository).'/'.urlencode($state).'/'.urlencode($keyword));
5252
}
5353

54+
/**
55+
* List issues by organization
56+
* @link http://developer.github.com/v3/issues/
57+
*
58+
* @param string $organization the organization
59+
* @param string $state the issue state, can be open or closed
60+
* @param array $params the additional parameters like milestone, assignees, labels, sort, direction
61+
* @return array list of issues found
62+
*/
63+
public function org($organization, $state, array $params = array())
64+
{
65+
if (!in_array($state, array('open', 'closed'))) {
66+
$state = 'open';
67+
}
68+
69+
return $this->get('orgs/'.urlencode($organization).'/issues', array_merge(array('page' => 1, 'state' => $state), $params));
70+
}
71+
5472
/**
5573
* Get extended information about an issue by its username, repo and number
5674
* @link http://developer.github.com/v3/issues/

0 commit comments

Comments
 (0)