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

1
2
3
public function hasParentComment() {
  return (bool) $this->get('pid')->target_id;
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.