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

File

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

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
EntityReferenceItemInterface::getReferenceableBundles public static function Returns the referenceable entity types and bundles.

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