Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Entity/FieldableEntityInterface.php \Drupal\Core\Entity\FieldableEntityInterface::get()
  2. 9 core/lib/Drupal/Core/Entity/FieldableEntityInterface.php \Drupal\Core\Entity\FieldableEntityInterface::get()

Gets a field item list.

Parameters

string $field_name: The name of the field to get; e.g., 'title' or 'name'.

Return value

\Drupal\Core\Field\FieldItemListInterface The field item list, containing the field items.

Throws

\InvalidArgumentException If an invalid field name is given.

65 calls to FieldableEntityInterface::get()
BlockContent::isReusable in core/modules/block_content/src/Entity/BlockContent.php
Determines if the block is reusable or not.
Comment::getAuthorEmail in core/modules/comment/src/Entity/Comment.php
Returns the comment author's email address.
Comment::getAuthorName in core/modules/comment/src/Entity/Comment.php
Returns the comment author's name.
Comment::getCommentedEntity in core/modules/comment/src/Entity/Comment.php
Returns the entity to which the comment is attached.
Comment::getCommentedEntityId in core/modules/comment/src/Entity/Comment.php
Returns the ID of the entity to which the comment is attached.

... See full list

File

core/lib/Drupal/Core/Entity/FieldableEntityInterface.php, line 151

Class

FieldableEntityInterface
Interface for entities having fields.

Namespace

Drupal\Core\Entity

Code

public function get($field_name);