Skip to content

Commit fccb516

Browse files
committed
Merge pull request KnpLabs#304 from kvdnberg/master
Add functionality for Organization:Issues
2 parents c9aa4cf + 059603d commit fccb516

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

doc/organization.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,20 @@ Additional APIs:
77
* [Members API](organization/members.md)
88
* [Teams API](organization/teams.md)
99

10+
### List issues in an organization
11+
[GitHub Issues API](https://developer.github.com/v3/issues/).
12+
13+
```php
14+
$issues = $client->api('orgs')->issues('KnpLabs', 'php-github-api', array('state' => 'open'));
15+
```
16+
You can specify the page number:
17+
18+
```php
19+
$issues = $client->api('orgs')->issues('KnpLabs', 'php-github-api', array('state' => 'open'), 2);
20+
```
21+
22+
Returns an array of issues.
23+
24+
25+
1026
To be written...

lib/Github/Api/Organization.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,18 @@ public function teams()
7474
{
7575
return new Teams($this->client);
7676
}
77+
78+
/**
79+
* @link http://developer.github.com/v3/issues/#list-issues
80+
*
81+
* @param $organization
82+
* @param array $params
83+
* @param int $page
84+
*
85+
* @return array
86+
*/
87+
public function issues($organization, array $params = array(), $page = 1)
88+
{
89+
return $this->get('orgs/'.rawurlencode($organization).'/issues', array_merge(array('page' => $page), $params));
90+
}
7791
}

0 commit comments

Comments
 (0)