Skip to content

Commit 1d73b89

Browse files
cheiffsphinx
authored andcommitted
Added create Project for user and createKey for user
1 parent 2b320f7 commit 1d73b89

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

lib/Gitlab/Model/Project.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,19 @@ public static function create(Client $client, $name, array $params = array())
9898
return static::fromArray($client, $data);
9999
}
100100

101+
/**
102+
* @param int $user_id
103+
* @param Client $client
104+
* @param string $name
105+
* @param array $params
106+
* @return Project
107+
*/
108+
public static function createForUser($user_id, Client $client, $name, array $params = array())
109+
{
110+
$data = $client->api('projects')->createForUser($user_id, $name, $params);
111+
112+
return static::fromArray($client, $data);
113+
}
101114
/**
102115
* @param int $id
103116
* @param Client $client

lib/Gitlab/Model/User.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,18 @@ public function createKey($title, $key)
155155
return Key::fromArray($this->getClient(), $data);
156156
}
157157

158+
/**
159+
* @param string $title
160+
* @param string $key
161+
* @return Key
162+
*/
163+
public function createKeyForUser($user_id, $title, $key)
164+
{
165+
$data = $this->api('users')->createKeyForUser($user_id, $title, $key);
166+
167+
return Key::fromArray($this->getClient(), $data);
168+
}
169+
158170
/**
159171
* @param int $id
160172
* @return bool

0 commit comments

Comments
 (0)