Comment::isPublished

public Comment::isPublished()

Checks if the comment is published.

Return value

bool TRUE if the comment is published.

Overrides CommentInterface::isPublished

File

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

Class

Comment
Defines the comment entity class.

Namespace

Drupal\comment\Entity

Code

1
2
3
public function isPublished() {
  return $this->get('status')->value == CommentInterface::PUBLISHED;
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.