public function Comment::getStatus in Drupal 8
Returns the comment's status.
Return value
int|string|bool Either TRUE, '1', or CommentInterface::PUBLISHED(1) if the comment is published, or FALSE, '0', or CommentInterface::NOT_PUBLISHED(0) if the comment is not published.
Overrides CommentInterface::getStatus
Deprecated
in drupal:8.3.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Entity\EntityPublishedInterface::isPublished() instead.
See also
https://www.drupal.org/node/2830201
File
- core/
modules/ comment/ src/ Entity/ Comment.php, line 486
Class
- Comment
- Defines the comment entity class.
Namespace
Drupal\comment\EntityCode
public function getStatus() {
@trigger_error(__NAMESPACE__ . '\\Comment::getStatus() is deprecated in drupal:8.3.0 and is removed from drupal:9.0.0. Use \\Drupal\\Core\\Entity\\EntityPublishedInterface::isPublished() instead. See https://www.drupal.org/node/2830201', E_USER_DEPRECATED);
return $this
->get('status')->value;
}