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

public function getCommentedEntityId() {
  return $this->get('entity_id')->target_id;
}
doc_Drupal
2016-10-29 08:50:20
Comments
Leave a Comment

Please login to continue.