Comment::referencedEntities

public Comment::referencedEntities()

Gets a list of entities referenced by this entity.

Return value

\Drupal\Core\Entity\EntityInterface[] An array of entities.

Overrides ContentEntityBase::referencedEntities

File

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

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;
}
doc_Drupal
2016-10-29 08:50:23
Comments
Leave a Comment

Please login to continue.