Skip to content

Commit

Permalink
Updated "caption" reference to new name "comment" in Comment model. A…
Browse files Browse the repository at this point in the history
…lso patched bug where non-existent setComments() function was being used to set child comments instead of setChildren().
  • Loading branch information
Reid Mayo committed Oct 11, 2015
1 parent 13149c2 commit 74fe82f
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions lib/Imgur/Api/Model/Comment.php
Expand Up @@ -30,7 +30,7 @@ class Comment {
*
* @var string
*/
private $caption;
private $comment;

/**
* Username of the author of the comment
Expand Down Expand Up @@ -89,14 +89,14 @@ class Comment {
private $datetime;

/**
* If this is a reply, this will be the value of the comment_id for the caption this a reply for.
* If this is a reply, this will be the value of the comment_id for the comment this a reply for.
*
* @var integer
*/
private $parentId;

/**
* Marked true if this caption has been deleted
* Marked true if this comment has been deleted
*
* @var boolean
*/
Expand Down Expand Up @@ -124,7 +124,7 @@ public function __construct($parameters) {
$this->setAlbumCover($parameters['album_cover'])
->setAuthor($parameters['author'])
->setAuthorId($parameters['author_id'])
->setCaption($parameters['caption'])
->setComment($parameters['comment'])
->setDatetime($parameters['datetime'])
->setDeleted($parameters['deleted'])
->setDowns($parameters['downs'])
Expand All @@ -140,7 +140,7 @@ public function __construct($parameters) {
foreach($parameters['children'] as $comment) {
$children[] = new Comment($comment);
}
$this->setComments($children);
$this->setChildren($children);
}

return $this;
Expand Down Expand Up @@ -195,19 +195,19 @@ public function setImageId($imageId) {
*
* @return string
*/
public function getCaption() {
public function getComment() {

return $this->caption;
return $this->comment;
}

/**
* The comment itself.
*
* @param string $caption
* @param string $comment
* @return \Imgur\Api\Model\Comment
*/
public function setCaption($caption) {
$this->caption = $caption;
public function setComment($comment) {
$this->comment = $comment;

return $this;
}
Expand Down Expand Up @@ -388,7 +388,7 @@ public function setDatetime($datetime) {
}

/**
* If this is a reply, this will be the value of the comment_id for the caption this a reply for.
* If this is a reply, this will be the value of the comment_id for the comment this a reply for.
*
* @return integer
*/
Expand All @@ -398,7 +398,7 @@ public function getParentId() {
}

/**
* If this is a reply, this will be the value of the comment_id for the caption this a reply for.
* If this is a reply, this will be the value of the comment_id for the comment this a reply for.
*
* @param integer $parentId
* @return \Imgur\Api\Model\Comment
Expand All @@ -410,7 +410,7 @@ public function setParentId($parentId) {
}

/**
* Marked true if this caption has been deleted
* Marked true if this comment has been deleted
*
* @return boolean
*/
Expand All @@ -420,7 +420,7 @@ public function getDeleted() {
}

/**
* Marked true if this caption has been deleted
* Marked true if this comment has been deleted
*
* @param boolean $deleted
* @return \Imgur\Api\Model\Comment
Expand Down Expand Up @@ -453,4 +453,4 @@ public function setChildren($children) {
return $this;
}
}


0 comments on commit 74fe82f

Please sign in to comment.