You are here

public function InlineFormInterface::getTableFields in Inline Entity Form 8

Gets the columns used to represent an entity in the IEF table.

Modules can alter the output of this method through hook_inline_entity_form_table_fields_alter().

Parameters

string[] $bundles: An array of allowed bundles for this widget.

Return value

array An array of data about table columns keyed by column name. Each column is represented by an associative array containing the following keys:

  • type: One of 'label', 'field' or 'callback', which indicates how this column should be handled:

    • 'label': The entity's label.
    • 'field': A field value from the entity. The name of the field is given by the key in this array.
    • 'callback': A callback, given by the 'callback' property.

    @see template_preprocess_inline_entity_form_entity_table() for the handling of these.

  • label: the title of the table field's column in the IEF table.
  • weight: the sort order of the column in the IEF table.
  • display_options: (optional) used for 'field' type table columns, an array of display settings. See EntityViewBuilderInterface::viewField().
  • callback: for 'callback' type table columns, a callable that returns a renderable array.
  • callback_arguments: (optional) an array of additional arguments to pass to the callback. The entity and the theme variables are always passed as as the first two arguments.
1 method overrides InlineFormInterface::getTableFields()
EntityInlineForm::getTableFields in src/Form/EntityInlineForm.php
Gets the columns used to represent an entity in the IEF table.

File

src/InlineFormInterface.php, line 75

Class

InlineFormInterface
Defines the interface for inline form handlers.

Namespace

Drupal\inline_entity_form

Code

public function getTableFields($bundles);