Comment::getCommentedEntityId

public Comment::getCommentedEntityId()

Returns the ID of the entity to which the comment is attached.

Return value

int The ID of the entity to which the comment is attached.

Overrides CommentInterface::getCommentedEntityId

File

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

Class

Comment
Defines the comment entity class.

Namespace

Drupal\comment\Entity

Code

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

Please login to continue.