Comment::getCommentedEntity

public Comment::getCommentedEntity()

Returns the entity to which the comment is attached.

Return value

\Drupal\Core\Entity\FieldableEntityInterface The entity on which the comment is attached.

Overrides CommentInterface::getCommentedEntity

File

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

Class

Comment
Defines the comment entity class.

Namespace

Drupal\comment\Entity

Code

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

Please login to continue.