interface EntityReferenceItemInterface

Same name and namespace in other branches
  1. 10 core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItemInterface.php \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItemInterface

Interface definition for field items referencing other entities.

Field items should extend \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItemBase.

Hierarchy

Expanded class hierarchy of EntityReferenceItemInterface

All classes that implement EntityReferenceItemInterface

2 files declare their use of EntityReferenceItemInterface
Exporter.php in core/lib/Drupal/Core/DefaultContent/Exporter.php
RelationshipNormalizer.php in core/modules/jsonapi/src/Normalizer/RelationshipNormalizer.php

File

core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItemInterface.php, line 13

Namespace

Drupal\Core\Field\Plugin\Field\FieldType
View source
interface EntityReferenceItemInterface {
  
  /**
   * Returns the referenceable entity types and bundles.
   *
   * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
   *   The field definition for which to retrieve the referenceable entity
   *   types and bundles.
   *
   * @return array
   *   An array of referenceable bundles where the array is keyed by the entity
   *   type ID, with values an array of bundle names. (It is a single-value
   *   array with the entity type ID if the entity type does not implement
   *   bundles.)
   */
  public static function getReferenceableBundles(FieldDefinitionInterface $field_definition) : array;

}

Members

Title Sort descending Modifiers Object type Summary Overrides
EntityReferenceItemInterface::getReferenceableBundles public static function Returns the referenceable entity types and bundles. 1

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.