Skip to content

Commit ea1cd47

Browse files
committed
Merge pull request #94 from cheiff/createuser
Added CreateProject for user and CreateKey for User
2 parents 3902658 + 1d73b89 commit ea1cd47

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
@@ -156,6 +156,18 @@ public function createKey($title, $key)
156156
return Key::fromArray($this->getClient(), $data);
157157
}
158158

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

0 commit comments

Comments
 (0)