You are here

public function Comment::referencedEntities in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/comment/src/Entity/Comment.php \Drupal\comment\Entity\Comment::referencedEntities()
  2. 9 core/modules/comment/src/Entity/Comment.php \Drupal\comment\Entity\Comment::referencedEntities()

File

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

Class

Comment
Defines the comment entity class.

Namespace

Drupal\comment\Entity

Code

public function referencedEntities() {
  $referenced_entities = parent::referencedEntities();
  if ($this
    ->getCommentedEntityId()) {
    $referenced_entities[] = $this
      ->getCommentedEntity();
  }
  return $referenced_entities;
}