Comment::postSave

public Comment::postSave(EntityStorageInterface $storage, $update = TRUE) Acts on a saved entity before the insert or update hook is invoked. Used after the entity is saved, but before invoking the insert or update hook. Note that in case of translatable content entities this callback is only fired on their current translation. It is up to the developer to iterate over all translations if needed. Parameters \Drupal\Core\Entity\EntityStorageInterface $storage: The entity storage object. bool $u

Comment::postDelete

public static Comment::postDelete(EntityStorageInterface $storage, array $entities) Acts on deleted entities before the delete hook is invoked. Used after the entities are deleted but before invoking the delete hook. Parameters \Drupal\Core\Entity\EntityStorageInterface $storage: The entity storage object. \Drupal\Core\Entity\EntityInterface[] $entities: An array of entities. Overrides Entity::postDelete File core/modules/comment/src/Entity/Comment.php, line 176 Class Comment Defines the

Comment::permalink

public Comment::permalink() Returns the permalink URL for this comment. Return value \Drupal\Core\Url Overrides CommentInterface::permalink File core/modules/comment/src/Entity/Comment.php, line 201 Class Comment Defines the comment entity class. Namespace Drupal\comment\Entity Code public function permalink() { $uri = $this->urlInfo(); $uri->setOption('fragment', 'comment-' . $this->id()); return $uri; }

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 public function isPublished() { return $this->get('status')->value == CommentInterface::PUBLISHED; }

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; }

Comment::getTypeId

public Comment::getTypeId() Get the comment type ID for this comment. Return value string The ID of the comment type. Overrides CommentInterface::getTypeId File core/modules/comment/src/Entity/Comment.php, line 562 Class Comment Defines the comment entity class. Namespace Drupal\comment\Entity Code public function getTypeId() { return $this->bundle(); }

Comment::getThread

public Comment::getThread() Returns the alphadecimal representation of the comment's place in a thread. Return value string The alphadecimal representation of the comment's place in a thread. Overrides CommentInterface::getThread File core/modules/comment/src/Entity/Comment.php, line 495 Class Comment Defines the comment entity class. Namespace Drupal\comment\Entity Code public function getThread() { $thread = $this->get('thread'); if (!empty($thread->value)) { return $t

Comment::getSubject

public Comment::getSubject() Returns the subject of the comment. Return value string The subject of the comment. Overrides CommentInterface::getSubject File core/modules/comment/src/Entity/Comment.php, line 379 Class Comment Defines the comment entity class. Namespace Drupal\comment\Entity Code public function getSubject() { return $this->get('subject')->value; }

Comment::getStatus

public Comment::getStatus() Returns the comment's status. Return value int One of CommentInterface::PUBLISHED or CommentInterface::NOT_PUBLISHED Overrides CommentInterface::getStatus File core/modules/comment/src/Entity/Comment.php, line 480 Class Comment Defines the comment entity class. Namespace Drupal\comment\Entity Code public function getStatus() { return $this->get('status')->value; }

Comment::getParentComment

public Comment::getParentComment() Returns the parent comment entity if this is a reply to a comment. Return value \Drupal\comment\CommentInterface|null A comment entity of the parent comment or NULL if there is no parent. Overrides CommentInterface::getParentComment File core/modules/comment/src/Entity/Comment.php, line 336 Class Comment Defines the comment entity class. Namespace Drupal\comment\Entity Code public function getParentComment() { return $this->get('pid')->entity