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; }
Please login to continue.