Skip to content

Commit e71eae0

Browse files
committed
Merge pull request #42 from jubianchi/issue-show-comments
Issues/MRs show comments
2 parents 3270322 + 00ac4c7 commit e71eae0

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

lib/Gitlab/Model/Issue.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,15 @@ public function addComment($body)
8787
return Note::fromArray($this->getClient(), $this, $data);
8888
}
8989

90+
public function showComments()
91+
{
92+
$notes = array();
93+
$data = $this->api('issues')->showComments($this->project->id, $this->id);
94+
95+
foreach ($data as $note) {
96+
$notes[] = Note::fromArray($this->getClient(), $this, $note);
97+
}
98+
99+
return $notes;
100+
}
90101
}

lib/Gitlab/Model/MergeRequest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,18 @@ public function addComment($note)
101101
return Note::fromArray($this->getClient(), $this, $data);
102102
}
103103

104+
public function showComments()
105+
{
106+
$notes = array();
107+
$data = $this->api('mr')->showComments($this->project->id, $this->id);
108+
109+
foreach ($data as $note) {
110+
$notes[] = Note::fromArray($this->getClient(), $this, $note);
111+
}
112+
113+
return $notes;
114+
}
115+
104116
public function isClosed()
105117
{
106118
if (in_array($this->state, array('closed', 'merged'))) {

0 commit comments

Comments
 (0)