Skip to content

Commit 00ac4c7

Browse files
committed
Add a method to retrieve a mr's comments
1 parent da0a6a9 commit 00ac4c7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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)