interface FormatterInterface in Reference Table Formatter 8
Interface required to implement a reference field formatter.
Hierarchy
- interface \Drupal\reference_table_formatter\FormatterInterface
Expanded class hierarchy of FormatterInterface
All classes that implement FormatterInterface
File
- src/
FormatterInterface.php, line 11
Namespace
Drupal\reference_table_formatterView source
interface FormatterInterface {
/**
* The the entity ID from the field value.
*
* @param \Drupal\Core\Field\FieldItemInterface $item
* The reference field to gain the ID for.
*
* @return int
* An entity ID.
*/
public function getEntityIdFromFieldItem(FieldItemInterface $item);
/**
* Get the target bundle from a reference field.
*
* @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
* The field definition to check the target bundle.
*
* @return string
* The bundle that is the target of the field.
*
* @throws \Exception
*/
public function getTargetBundleId(FieldDefinitionInterface $field_definition);
/**
* Get the entity which is the target of the reference field.
*
* @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
* The field definition.
*
* @return string
* The entity which is the target of the reference.
*/
public function getTargetEntityId(FieldDefinitionInterface $field_definition);
/**
* Get the view modes which can be selected for this field formatter.
*/
public function getConfigurableViewModes();
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FormatterInterface:: |
public | function | Get the view modes which can be selected for this field formatter. | 1 |
FormatterInterface:: |
public | function | The the entity ID from the field value. | 2 |
FormatterInterface:: |
public | function | Get the target bundle from a reference field. | 2 |
FormatterInterface:: |
public | function | Get the entity which is the target of the reference field. | 2 |