Skip to content

Commit 871f7c2

Browse files
bmalex88m1guelpf
authored andcommitted
Tag message and release properties
1 parent 4d4e7c8 commit 871f7c2

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

lib/Gitlab/Model/Release.php

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php namespace Gitlab\Model;
2+
3+
use Gitlab\Client;
4+
5+
/**
6+
* Class Release
7+
*
8+
* @property-read string $tag_name
9+
* @property-read string $description
10+
* @property-read Commit $commit
11+
*/
12+
class Release extends AbstractModel
13+
{
14+
/**
15+
* @var array
16+
*/
17+
protected static $properties = array(
18+
'tag_name',
19+
'description'
20+
);
21+
22+
/**
23+
* @param Client $client
24+
* @param array $data
25+
* @return Release
26+
*/
27+
public static function fromArray(Client $client, array $data)
28+
{
29+
$release = new static($client);
30+
31+
return $release->hydrate($data);
32+
}
33+
34+
/**
35+
* @param Project $project
36+
* @param int $id
37+
* @param Client $client
38+
*/
39+
public function __construct(Client $client = null)
40+
{
41+
$this->setClient($client);
42+
}
43+
}

lib/Gitlab/Model/Tag.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ class Tag extends AbstractModel
1717
*/
1818
protected static $properties = array(
1919
'name',
20+
'message',
2021
'commit',
22+
'release',
2123
'project',
2224
'protected'
2325
);
@@ -36,6 +38,10 @@ public static function fromArray(Client $client, Project $project, array $data)
3638
$data['commit'] = Commit::fromArray($client, $project, $data['commit']);
3739
}
3840

41+
if (isset($data['release'])) {
42+
$data['release'] = Release::fromArray($client, $data['release']);
43+
}
44+
3945
return $branch->hydrate($data);
4046
}
4147

0 commit comments

Comments
 (0)