Drupal 8  8.0.2
EntityDisplayFormBase Class Reference
Inheritance diagram for EntityDisplayFormBase:

Public Member Functions

 __construct (FieldTypePluginManagerInterface $field_type_manager, PluginManagerBase $plugin_manager)
 
 getEntityFromRouteMatch (RouteMatchInterface $route_match, $entity_type_id)
 
 getRegions ()
 
 getRegionOptions ()
 
 form (array $form, FormStateInterface $form_state)
 
 submitForm (array &$form, FormStateInterface $form_state)
 
 multistepSubmit ($form, FormStateInterface $form_state)
 
 multistepAjax ($form, FormStateInterface $form_state)
 
 tablePreRender ($elements)
 
 reduceOrder ($array, $a)
 
 getRowRegion ($row)
 
- Public Member Functions inherited from EntityForm
 setOperation ($operation)
 
 getBaseFormId ()
 
 getFormId ()
 
 buildForm (array $form, FormStateInterface $form_state)
 
 form (array $form, FormStateInterface $form_state)
 
 processForm ($element, FormStateInterface $form_state, $form)
 
 afterBuild (array $element, FormStateInterface $form_state)
 
 submitForm (array &$form, FormStateInterface $form_state)
 
 save (array $form, FormStateInterface $form_state)
 
 buildEntity (array $form, FormStateInterface $form_state)
 
 getEntity ()
 
 setEntity (EntityInterface $entity)
 
 getEntityFromRouteMatch (RouteMatchInterface $route_match, $entity_type_id)
 
 getOperation ()
 
 setModuleHandler (ModuleHandlerInterface $module_handler)
 
 setEntityManager (EntityManagerInterface $entity_manager)
 
 setEntityTypeManager (EntityTypeManagerInterface $entity_type_manager)
 
- Public Member Functions inherited from EntityFormInterface
 setStringTranslation (TranslationInterface $string_translation)
 
- Public Member Functions inherited from FormInterface
 validateForm (array &$form, FormStateInterface $form_state)
 

Protected Member Functions

 getFieldDefinitions ()
 
 buildFieldRow (FieldDefinitionInterface $field_definition, array $form, FormStateInterface $form_state)
 
 buildExtraFieldRow ($field_id, $extra_field)
 
 copyFormValuesToEntity (EntityInterface $entity, array $form, FormStateInterface $form_state)
 
 getExtraFields ()
 
 getEntityDisplay ($entity_type_id, $bundle, $mode)
 
 getApplicablePluginOptions (FieldDefinitionInterface $field_definition)
 
 getPluginOptions (FieldDefinitionInterface $field_definition)
 
 getDefaultPlugin ($field_type)
 
 getDisplayModes ()
 
 getDisplayModeOptions ()
 
 getExtraFieldVisibilityOptions ()
 
 getDisplays ()
 
 getDisplayStatuses ()
 
 saveDisplayStatuses ($display_statuses)
 
 getTableHeader ()
 
 getOverviewUrl ($mode)
 
 thirdPartySettingsForm (PluginSettingsInterface $plugin, FieldDefinitionInterface $field_definition, array $form, FormStateInterface $form_state)
 
 alterSettingsSummary (array &$summary, PluginSettingsInterface $plugin, FieldDefinitionInterface $field_definition)
 
- Protected Member Functions inherited from EntityForm
 init (FormStateInterface $form_state)
 
 actionsElement (array $form, FormStateInterface $form_state)
 
 actions (array $form, FormStateInterface $form_state)
 
 copyFormValuesToEntity (EntityInterface $entity, array $form, FormStateInterface $form_state)
 
 prepareEntity ()
 
 prepareInvokeAll ($hook, FormStateInterface $form_state)
 

Protected Attributes

 $displayContext
 
 $pluginManager
 
 $fieldTypes
 
 $entity
 
- Protected Attributes inherited from EntityForm
 $operation
 
 $moduleHandler
 
 $entityManager
 
 $entityTypeManager
 
 $entity
 

Detailed Description

Base class for EntityDisplay edit forms.

Constructor & Destructor Documentation

__construct ( FieldTypePluginManagerInterface  $field_type_manager,
PluginManagerBase  $plugin_manager 
)

Constructs a new EntityDisplayFormBase.

Parameters
\Drupal\Core\Field\FieldTypePluginManagerInterface$field_type_managerThe field type manager.
\Drupal\Component\Plugin\PluginManagerBase$plugin_managerThe widget or formatter plugin manager.

References DiscoveryInterface\getDefinitions().

Here is the call graph for this function:

Member Function Documentation

alterSettingsSummary ( array &  $summary,
PluginSettingsInterface  $plugin,
FieldDefinitionInterface  $field_definition 
)
abstractprotected

Alters the widget or formatter settings summary.

Parameters
array$summaryThe widget or formatter settings summary.
\Drupal\Core\Field\PluginSettingsInterface$pluginThe widget or formatter.
\Drupal\Core\Field\FieldDefinitionInterface$field_definitionThe field definition.

Referenced by EntityDisplayFormBase\buildFieldRow().

Here is the caller graph for this function:

buildExtraFieldRow (   $field_id,
  $extra_field 
)
protected

Builds the table row structure for a single extra field.

Parameters
string$field_idThe field ID.
array$extra_fieldThe pseudo-field element.
Returns
array A table row array.

References EntityDisplayFormBase\getExtraFieldVisibilityOptions(), EntityDisplayFormBase\getRegions(), and t().

Referenced by EntityDisplayFormBase\form().

Here is the call graph for this function:

Here is the caller graph for this function:

buildFieldRow ( FieldDefinitionInterface  $field_definition,
array  $form,
FormStateInterface  $form_state 
)
protected

Builds the table row structure for a single field.

Parameters
\Drupal\Core\Field\FieldDefinitionInterface$field_definitionThe field definition.
array$formAn associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the form.
Returns
array A table row array.

References EntityDisplayFormBase\alterSettingsSummary(), FormStateInterface\get(), EntityDisplayFormBase\getApplicablePluginOptions(), EntityDisplayFormBase\getDefaultPlugin(), DataDefinitionInterface\getLabel(), FieldDefinitionInterface\getName(), EntityDisplayFormBase\getPluginOptions(), EntityDisplayFormBase\getRegions(), FieldDefinitionInterface\getType(), t(), and EntityDisplayFormBase\thirdPartySettingsForm().

Referenced by EntityDisplayFormBase\form().

Here is the call graph for this function:

Here is the caller graph for this function:

copyFormValuesToEntity ( EntityInterface  $entity,
array  $form,
FormStateInterface  $form_state 
)
protected

{}

References FormStateInterface\get(), FormStateInterface\getValues(), and FormStateInterface\set().

Here is the call graph for this function:

getApplicablePluginOptions ( FieldDefinitionInterface  $field_definition)
protected

Returns an array of applicable widget or formatter options for a field.

Parameters
\Drupal\Core\Field\FieldDefinitionInterface$field_definitionThe field definition.
Returns
array An array of applicable widget or formatter options.

References DefaultFactory\getPluginClass(), and FieldDefinitionInterface\getType().

Referenced by EntityDisplayFormBase\buildFieldRow(), and EntityDisplayFormBase\getPluginOptions().

Here is the call graph for this function:

Here is the caller graph for this function:

getDefaultPlugin (   $field_type)
abstractprotected

Returns the ID of the default widget or formatter plugin for a field type.

Parameters
string$field_typeThe field type.
Returns
string The widget or formatter plugin ID.

Referenced by EntityDisplayFormBase\buildFieldRow().

Here is the caller graph for this function:

getDisplayModeOptions ( )
abstractprotected

Returns an array of form or view mode options.

Returns
array An array of form or view mode options.

Referenced by EntityDisplayFormBase\form().

Here is the caller graph for this function:

getDisplayModes ( )
abstractprotected

Returns the form or view modes used by this form.

Returns
array An array of form or view mode info.

Referenced by EntityDisplayFormBase\submitForm().

Here is the caller graph for this function:

getDisplays ( )
protected

Returns entity (form) displays for the current entity display type.

Returns
[] An array holding entity displays or entity form displays.

References Drupal\configFactory(), and Drupal\entityManager().

Referenced by EntityDisplayFormBase\getDisplayStatuses(), and EntityDisplayFormBase\saveDisplayStatuses().

Here is the call graph for this function:

Here is the caller graph for this function:

getDisplayStatuses ( )
protected

Returns form or view modes statuses for the bundle used by this form.

Returns
array An array of form or view mode statuses.

References EntityDisplayFormBase\getDisplays().

Referenced by EntityDisplayFormBase\form(), and EntityDisplayFormBase\submitForm().

Here is the call graph for this function:

Here is the caller graph for this function:

getEntityDisplay (   $entity_type_id,
  $bundle,
  $mode 
)
abstractprotected

Returns an entity display object to be used by this form.

Parameters
string$entity_type_idThe target entity type ID of the entity display.
string$bundleThe target bundle of the entity display.
string$modeA view or form mode.
Returns
An entity display.

Referenced by EntityDisplayFormBase\getEntityFromRouteMatch(), and EntityDisplayFormBase\submitForm().

Here is the caller graph for this function:

getEntityFromRouteMatch ( RouteMatchInterface  $route_match,
  $entity_type_id 
)

{Determines which entity will be used by this form from a RouteMatch object.

Parameters
\Drupal\Core\Routing\RouteMatchInterface$route_matchThe route match.
string$entity_type_idThe entity type identifier.
Returns
The entity object as determined from the passed-in route match.
}

Implements EntityFormInterface.

References EntityDisplayFormBase\getEntityDisplay(), and RouteMatchInterface\getParameters().

Here is the call graph for this function:

getExtraFields ( )
protected

Returns the extra fields of the entity type and bundle used by this form.

Returns
array An array of extra field info.
See Also
::getExtraFields()

References Drupal\entityManager().

Referenced by EntityDisplayFormBase\form().

Here is the call graph for this function:

Here is the caller graph for this function:

getExtraFieldVisibilityOptions ( )
protected

Returns an array of visibility options for extra fields.

Returns
array An array of visibility options.

References t().

Referenced by EntityDisplayFormBase\buildExtraFieldRow().

Here is the call graph for this function:

Here is the caller graph for this function:

getFieldDefinitions ( )
protected

Collects the definitions of fields whose display is configurable.

Returns
[] The array of field definitions

References Drupal\entityManager(), and FieldDefinitionInterface\isDisplayConfigurable().

Referenced by EntityDisplayFormBase\form().

Here is the call graph for this function:

Here is the caller graph for this function:

getOverviewUrl (   $mode)
abstractprotected

Returns the Url object for a specific entity (form) display edit form.

Parameters
string$modeThe form or view mode.
Returns
A Url object for the overview route.

Referenced by EntityDisplayFormBase\submitForm().

Here is the caller graph for this function:

getPluginOptions ( FieldDefinitionInterface  $field_definition)
protected

Returns an array of widget or formatter options for a field.

Parameters
\Drupal\Core\Field\FieldDefinitionInterface$field_definitionThe field definition.
Returns
array An array of widget or formatter options.

References EntityDisplayFormBase\getApplicablePluginOptions(), and t().

Referenced by EntityDisplayFormBase\buildFieldRow().

Here is the call graph for this function:

Here is the caller graph for this function:

getRegionOptions ( )

Returns an associative array of all regions.

Returns
array An array containing the region options.

References EntityDisplayFormBase\getRegions().

Here is the call graph for this function:

getRegions ( )

Get the regions needed to create the overview form.

Returns
array Example usage:
return array(
'content' => array(
// label for the region.
'title' => $this->t('Content'),
// Indicates if the region is visible in the UI.
'invisible' => TRUE,
// A message to indicate that there is nothing to be displayed in
// the region.
'message' => $this->t('No field is displayed.'),
),
);

References t().

Referenced by EntityDisplayFormBase\buildExtraFieldRow(), EntityDisplayFormBase\buildFieldRow(), EntityDisplayFormBase\form(), and EntityDisplayFormBase\getRegionOptions().

Here is the call graph for this function:

Here is the caller graph for this function:

getRowRegion (   $row)

Returns the region to which a row in the display overview belongs.

Parameters
array$rowThe row element.
Returns
string|null The region name this row belongs to.
getTableHeader ( )
abstractprotected

Returns an array containing the table headers.

Returns
array The table header.

Referenced by EntityDisplayFormBase\form().

Here is the caller graph for this function:

multistepAjax (   $form,
FormStateInterface  $form_state 
)

Ajax handler for multistep buttons.

References FormStateInterface\getTriggeringElement(), and FormStateInterface\getValue().

Here is the call graph for this function:

multistepSubmit (   $form,
FormStateInterface  $form_state 
)

Form submission handler for multistep buttons.

References EntityForm\buildEntity(), FormStateInterface\get(), FormStateInterface\getTriggeringElement(), FormStateInterface\getValue(), FormStateInterface\set(), and FormStateInterface\setRebuild().

Here is the call graph for this function:

reduceOrder (   $array,
  $a 
)

Determines the rendering order of an array representing a tree.

Callback for array_reduce() within ::tablePreRender().

Deprecated:
in Drupal 8.0.0, will be removed before Drupal 9.0.0.

References FieldUiTable\reduceOrder().

Here is the call graph for this function:

saveDisplayStatuses (   $display_statuses)
protected

Saves the updated display mode statuses.

Parameters
array$display_statusesAn array holding updated form or view mode statuses.

References EntityDisplayFormBase\getDisplays().

Referenced by EntityDisplayFormBase\submitForm().

Here is the call graph for this function:

Here is the caller graph for this function:

submitForm ( array &  $form,
FormStateInterface  $form_state 
)

{Form submission handler.

Parameters
array$formAn associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the form.
}

Implements FormInterface.

References Drupal\entityManager(), FormStateInterface\get(), EntityDisplayFormBase\getDisplayModes(), EntityDisplayFormBase\getDisplayStatuses(), EntityDisplayFormBase\getEntityDisplay(), EntityDisplayFormBase\getOverviewUrl(), FormStateInterface\getValues(), EntityDisplayFormBase\saveDisplayStatuses(), FormStateInterface\set(), and t().

Here is the call graph for this function:

tablePreRender (   $elements)

Performs pre-render tasks on field_ui_table elements.

Parameters
array$elementsA structured array containing two sub-levels of elements. Properties used:
  • #tabledrag: The value is a list of $options arrays that are passed to drupal_attach_tabledrag(). The HTML ID of the table is added to each $options array.
Returns
array
See Also
drupal_render()
::preRenderTable()
Deprecated:
in Drupal 8.0.0, will be removed before Drupal 9.0.0.

References FieldUiTable\tablePreRender().

Here is the call graph for this function:

thirdPartySettingsForm ( PluginSettingsInterface  $plugin,
FieldDefinitionInterface  $field_definition,
array  $form,
FormStateInterface  $form_state 
)
abstractprotected

Adds the widget or formatter third party settings forms.

Parameters
\Drupal\Core\Field\PluginSettingsInterface$pluginThe widget or formatter.
\Drupal\Core\Field\FieldDefinitionInterface$field_definitionThe field definition.
array$formThe (entire) configuration form array.
\Drupal\Core\Form\FormStateInterface$form_stateThe form state.
Returns
array The widget or formatter third party settings form.

Referenced by EntityDisplayFormBase\buildFieldRow().

Here is the caller graph for this function:


The documentation for this class was generated from the following file: