Comment::preCreate

public static Comment::preCreate(EntityStorageInterface $storage, array &$values) Changes the values of an entity before it is created. Load defaults for example. Parameters \Drupal\Core\Entity\EntityStorageInterface $storage: The entity storage object. mixed[] $values: An array of values to set, keyed by property name. If the entity type has bundles the bundle key has to be specified. Overrides Entity::preCreate File core/modules/comment/src/Entity/Comment.php, line 513 Class Comment

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::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::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::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::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::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::getOwner

public Comment::getOwner() Returns the entity owner's user entity. Return value \Drupal\user\UserInterface The owner user entity. Overrides EntityOwnerInterface::getOwner File core/modules/comment/src/Entity/Comment.php, line 523 Class Comment Defines the comment entity class. Namespace Drupal\comment\Entity Code public function getOwner() { $user = $this->get('uid')->entity; if (!$user || $user->isAnonymous()) { $user = User::getAnonymousUser(); $user->name =

Comment::getOwnerId

public Comment::getOwnerId() Returns the entity owner's user ID. Return value int|null The owner user ID, or NULL in case the user ID field has not been set on the entity. Overrides EntityOwnerInterface::getOwnerId File core/modules/comment/src/Entity/Comment.php, line 536 Class Comment Defines the comment entity class. Namespace Drupal\comment\Entity Code public function getOwnerId() { return $this->get('uid')->target_id; }