Comment::hasParentComment

public Comment::hasParentComment()

Determines if this comment is a reply to another comment.

Return value

bool TRUE if the comment has a parent comment otherwise FALSE.

Overrides CommentInterface::hasParentComment

File

core/modules/comment/src/Entity/Comment.php, line 329

Class

Comment
Defines the comment entity class.

Namespace

Drupal\comment\Entity

Code

public function hasParentComment() {
  return (bool) $this->get('pid')->target_id;
}
doc_Drupal
2016-10-29 08:50:22
Comments
Leave a Comment

Please login to continue.