Skip to content

Commit 94ac618

Browse files
author
Matt Humphrey
committed
Added support for new fields added in 6.2 (iid etc) and added methods to remove projects
1 parent e397725 commit 94ac618

File tree

6 files changed

+24
-2
lines changed

6 files changed

+24
-2
lines changed

lib/Gitlab/Api/Projects.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ public function create($name, array $params = array())
2424
return $this->post('projects', $params);
2525
}
2626

27+
public function remove($project_id)
28+
{
29+
return $this->delete('projects/'.urlencode($project_id));
30+
}
31+
2732
public function members($project_id, $username_query = null)
2833
{
2934
return $this->get('projects/'.urlencode($project_id).'/members', array(

lib/Gitlab/Model/Issue.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class Issue extends AbstractModel
88
{
99
protected static $_properties = array(
1010
'id',
11+
'iid',
1112
'project_id',
1213
'title',
1314
'description',

lib/Gitlab/Model/MergeRequest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class MergeRequest extends AbstractModel
88
{
99
protected static $_properties = array(
1010
'id',
11+
'iid',
1112
'target_branch',
1213
'source_branch',
1314
'project_id',
@@ -17,7 +18,11 @@ class MergeRequest extends AbstractModel
1718
'author',
1819
'assignee',
1920
'project',
20-
'state'
21+
'state',
22+
'source_project_id',
23+
'target_project_id',
24+
'upvotes',
25+
'downvotes'
2126
);
2227

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

lib/Gitlab/Model/Milestone.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class Milestone extends AbstractModel
88
{
99
protected static $_properties = array(
1010
'id',
11+
'iid',
1112
'project',
1213
'project_id',
1314
'title',

lib/Gitlab/Model/Project.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ public function show()
6565
return Project::fromArray($this->getClient(), $data);
6666
}
6767

68+
public function remove()
69+
{
70+
$this->api('projects')->remove($this->id);
71+
72+
return true;
73+
}
74+
6875
public function members($username_query = null)
6976
{
7077
$data = $this->api('projects')->members($this->id, $username_query);

lib/Gitlab/Model/User.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ class User extends AbstractModel
2525
'created_at',
2626
'extern_uid',
2727
'provider',
28-
'state'
28+
'state',
29+
'is_admin',
30+
'can_create_group',
31+
'can_create_project'
2932
);
3033

3134
public static function fromArray(Client $client, array $data)

0 commit comments

Comments
 (0)