FieldLayoutEntityViewDisplayEditForm
class FieldLayoutEntityViewDisplayEditForm extends EntityViewDisplayEditForm (View source)
| internal |
Edit form for the EntityViewDisplay entity type.
Traits
Provides shared code for entity display forms.
Provides dependency injection friendly methods for serialization.
Wrapper methods for the Link Generator.
Wrapper methods for the logger factory service.
Provides a trait for the messenger service.
Wrapper methods for the Redirect Destination.
Wrapper methods for \Drupal\Core\StringTranslation\TranslationInterface.
Wrapper methods for the Url Generator.
Properties
| protected array | $_serviceIds | An array of service IDs keyed by property name used for serialization. |
from DependencySerializationTrait |
| protected array | $_entityStorages | An array of entity type IDs keyed by the property name of their storages. |
from DependencySerializationTrait |
| protected LinkGeneratorInterface | $linkGenerator | The link generator. |
from LinkGeneratorTrait |
| protected LoggerChannelFactoryInterface | $loggerFactory | The logger channel factory service. |
from LoggerChannelTrait |
| protected MessengerInterface | $messenger | The messenger. |
from MessengerTrait |
| protected RedirectDestinationInterface | $redirectDestination | The redirect destination service. |
from RedirectDestinationTrait |
| protected TranslationInterface | $stringTranslation | The string translation service. |
from StringTranslationTrait |
| protected UrlGeneratorInterface | $urlGenerator | The url generator. |
from UrlGeneratorTrait |
| protected RequestStack | $requestStack | The request stack. |
from FormBase |
| protected ConfigFactoryInterface | $configFactory | The config factory. |
from FormBase |
| protected RouteMatchInterface | $routeMatch | The route match. |
from FormBase |
| protected string | $operation | The name of the current operation. |
from EntityForm |
| protected ModuleHandlerInterface | $moduleHandler | The module handler service. |
from EntityForm |
| protected EntityTypeManagerInterface | $entityTypeManager | The entity type manager. |
from EntityForm |
| protected EntityDisplayInterface | $entity | The entity being used by this form. |
from EntityDisplayFormBase |
| protected | $displayContext | {@inheritdoc} | from EntityViewDisplayEditForm |
| protected PluginManagerBase | $pluginManager | The widget or formatter plugin manager. |
from EntityDisplayFormBase |
| protected EntityDisplayRepositoryInterface | $entityDisplayRepository | The entity display repository. |
from EntityDisplayFormBase |
| protected EntityFieldManagerInterface | $entityFieldManager | The entity field manager. |
from EntityDisplayFormBase |
| protected array | $fieldTypes | A list of field types. |
from EntityDisplayFormBase |
| protected LayoutPluginManagerInterface | $layoutPluginManager | The field layout plugin manager. |
from FieldLayoutEntityDisplayFormTrait |
Methods
Gets the logger for a specific channel.
Prepares a 'destination' URL query parameter for use with \Drupal\Core\Url.
Returns the redirect destination service.
Sets the redirect destination service.
Translates a string to the current language or to a given language.
Formats a string containing a count of items.
Returns the number of plurals supported by a given language.
Gets the string translation service.
Generates a URL or path for a specific route based on the given parameters.
Returns a redirect response object for the specified route.
Instantiates a new instance of this class.
Overrides \Drupal\field_ui\Form\EntityDisplayFormBase::validateForm().
Sets the request stack object to use.
Initialize the form state and the entity before the first form build.
Overrides \Drupal\field_ui\Form\EntityDisplayFormBase::form().
Process callback: assigns weights and hides extra fields.
Form element #after_build callback: Updates the entity with submitted data.
Returns the action form element for the current entity form.
Returns an array of supported actions for the current entity form.
Overrides \Drupal\field_ui\Form\EntityDisplayFormBase::submitForm().
Builds an updated entity object based upon the submitted form values.
Copies top-level form values to entity properties
Gets the form entity.
Determines which entity will be used by this form from a RouteMatch object.
Invokes the specified prepare hook variant.
Sets the entity type manager for this form.
FieldLayoutEntityViewDisplayEditForm constructor.
Overrides \Drupal\field_ui\Form\EntityDisplayFormBase::getRegions().
Collects the definitions of fields whose display is configurable.
Builds the table row structure for a single field.
Builds the table row structure for a single extra field.
Form submission handler for multistep buttons.
Returns the extra fields of the entity type and bundle used by this form.
Returns an entity display object to be used by this form.
Returns an array of applicable widget or formatter options for a field.
Returns the ID of the default widget or formatter plugin for a field type.
Returns the form or view modes used by this form.
Returns an array of form or view mode options.
Returns a link to the form or view mode admin page.
Returns the region to which a row in the display overview belongs.
Returns entity (form) displays for the current entity display type.
Returns form or view modes statuses for the bundle used by this form.
Saves the updated display mode statuses.
Returns an array containing the table headers.
Returns the Url object for a specific entity (form) display edit form.
Adds the widget or formatter third party settings forms.
Alters the widget or formatter settings summary.
Returns an array of visibility options for field labels.
Gets the layout plugin for the currently selected field layout.
Ajax callback for the field layout settings form.
Details
__sleep()
{@inheritdoc}
__wakeup()
{@inheritdoc}
protected GeneratedLink
l($text, Url $url)
deprecated
deprecated
Renders a link to a route given a route name and its parameters.
For details on the arguments, usage, and possible exceptions see \Drupal\Core\Utility\LinkGeneratorInterface::generate().
protected LinkGeneratorInterface
getLinkGenerator()
deprecated
deprecated
Returns the link generator.
$this
setLinkGenerator(LinkGeneratorInterface $generator)
deprecated
deprecated
Sets the link generator service.
protected LoggerInterface
getLogger(string $channel)
Gets the logger for a specific channel.
$this
setLoggerFactory(LoggerChannelFactoryInterface $logger_factory)
Injects the logger channel factory.
setMessenger(MessengerInterface $messenger)
Sets the messenger.
MessengerInterface
messenger()
Gets the messenger.
protected array
getDestinationArray()
Prepares a 'destination' URL query parameter for use with \Drupal\Core\Url.
protected RedirectDestinationInterface
getRedirectDestination()
Returns the redirect destination service.
$this
setRedirectDestination(RedirectDestinationInterface $redirect_destination)
Sets the redirect destination service.
protected TranslatableMarkup
t(string $string, array $args = [], array $options = [])
Translates a string to the current language or to a given language.
See \Drupal\Core\StringTranslation\TranslatableMarkup::__construct() for important security information and usage guidelines.
In order for strings to be localized, make them available in one of the ways supported by the
protected
formatPlural($count, $singular, $plural, array $args = [], array $options = [])
Formats a string containing a count of items.
protected
getNumberOfPlurals($langcode = NULL)
Returns the number of plurals supported by a given language.
protected TranslationInterface
getStringTranslation()
Gets the string translation service.
$this
setStringTranslation(TranslationInterface $translation)
Sets the string translation service to use.
protected string
url($route_name, $route_parameters = [], $options = [])
deprecated
deprecated
Generates a URL or path for a specific route based on the given parameters.
For details on the arguments, usage, and possible exceptions see \Drupal\Core\Routing\UrlGeneratorInterface::generateFromRoute().
protected RedirectResponse
redirect(string $route_name, array $route_parameters = [], array $options = [], int $status = 302)
deprecated
deprecated
Returns a redirect response object for the specified route.
protected UrlGeneratorInterface
getUrlGenerator()
deprecated
deprecated
Returns the URL generator service.
$this
setUrlGenerator(UrlGeneratorInterface $generator)
deprecated
deprecated
Sets the URL generator service.
static
create(ContainerInterface $container)
Instantiates a new instance of this class.
This is a factory method that returns a new instance of this class. The factory should pass any needed dependencies into the constructor of this class, but not the container itself. Every call to this method must return a new instance of this class; that is, it may not implement a singleton.
validateForm(array $form, FormStateInterface $form_state)
Overrides \Drupal\field_ui\Form\EntityDisplayFormBase::validateForm().
protected ImmutableConfig
config(string $name)
Retrieves a configuration object.
This is the main entry point to the configuration API. Calling
protected ConfigFactoryInterface
configFactory()
Gets the config factory for this form.
When accessing configuration values, use $this->config(). Only use this when the config factory needs to be manipulated directly.
$this
setConfigFactory(ConfigFactoryInterface $config_factory)
Sets the config factory for this form.
resetConfigFactory()
Resets the configuration factory.
protected Request
getRequest()
Gets the request object.
protected RouteMatchInterface
getRouteMatch()
Gets the route match.
$this
setRequestStack(RequestStack $request_stack)
Sets the request stack object to use.
protected AccountInterface
currentUser()
Gets the current user.
protected LoggerInterface
logger(string $channel)
Gets the logger for a specific channel.
This method exists for backward-compatibility between FormBase and LoggerChannelTrait. Use LoggerChannelTrait::getLogger() instead.
__get($name)
{@inheritdoc}
__set($name, $value)
{@inheritdoc}
$this
setOperation(string $operation)
Sets the operation for this form.
string|null
getBaseFormId()
Returns a string identifying the base form.
string
getFormId()
Returns a unique string identifying the form.
The returned ID should be a unique string that can be a valid PHP function name, since it's used in hook implementation names such as hook_form_FORM_ID_alter().
array
buildForm(array $form, FormStateInterface $form_state)
Form constructor.
protected
init(FormStateInterface $form_state)
Initialize the form state and the entity before the first form build.
form(array $form, FormStateInterface $form_state)
Overrides \Drupal\field_ui\Form\EntityDisplayFormBase::form().
processForm($element, FormStateInterface $form_state, $form)
Process callback: assigns weights and hides extra fields.
afterBuild(array $element, FormStateInterface $form_state)
Form element #after_build callback: Updates the entity with submitted data.
Updates the internal $this->entity object with submitted values when the form is being rebuilt (e.g. submitted via AJAX), so that subsequent processing (e.g. AJAX callbacks) can rely on it.
protected
actionsElement(array $form, FormStateInterface $form_state)
Returns the action form element for the current entity form.
protected array
actions(array $form, FormStateInterface $form_state)
Returns an array of supported actions for the current entity form.
This function generates a list of Form API elements which represent actions supported by the current entity form.
submitForm(array $form, FormStateInterface $form_state)
Overrides \Drupal\field_ui\Form\EntityDisplayFormBase::submitForm().
int
save(array $form, FormStateInterface $form_state)
Form submission handler for the 'save' action.
Normally this method should be overridden to provide specific messages to the user and redirect the form after the entity has been saved.
EntityInterface
buildEntity(array $form, FormStateInterface $form_state)
Builds an updated entity object based upon the submitted form values.
For building the updated entity object the form's entity is cloned and the submitted form values are copied to entity properties. The form's entity remains unchanged.
protected
copyFormValuesToEntity(EntityInterface $entity, array $form, FormStateInterface $form_state)
Copies top-level form values to entity properties
This should not change existing entity properties that are not being edited by this form.
abstract EntityDisplayWithLayoutInterface
getEntity()
Gets the form entity.
$this
setEntity(EntityInterface $entity)
Sets the form entity.
Sets the form entity which will be used for populating form element defaults. Usually, the form entity gets updated by \Drupal\Core\Entity\EntityFormInterface::submit(), however this may be used to completely exchange the form entity, e.g. when preparing the rebuild of a multi-step form.
EntityInterface
getEntityFromRouteMatch(RouteMatchInterface $route_match, string $entity_type_id)
Determines which entity will be used by this form from a RouteMatch object.
protected
prepareEntity()
Prepares the entity object before the form is built first.
protected
prepareInvokeAll(string $hook, FormStateInterface $form_state)
Invokes the specified prepare hook variant.
string
getOperation()
Gets the operation identifying the form.
$this
setModuleHandler(ModuleHandlerInterface $module_handler)
Sets the module handler for this form.
$this
setEntityManager(EntityManagerInterface $entity_manager)
Sets the entity manager for this form.
$this
setEntityTypeManager(EntityTypeManagerInterface $entity_type_manager)
Sets the entity type manager for this form.
__construct(FieldTypePluginManagerInterface $field_type_manager, PluginManagerBase $plugin_manager, LayoutPluginManagerInterface $layout_plugin_manager, EntityDisplayRepositoryInterface $entity_display_repository = NULL, EntityFieldManagerInterface $entity_field_manager = NULL)
FieldLayoutEntityViewDisplayEditForm constructor.
getRegions()
Overrides \Drupal\field_ui\Form\EntityDisplayFormBase::getRegions().
array
getRegionOptions()
Returns an associative array of all regions.
protected FieldDefinitionInterface[]
getFieldDefinitions()
Collects the definitions of fields whose display is configurable.
protected array
buildFieldRow(FieldDefinitionInterface $field_definition, array $form, FormStateInterface $form_state)
Builds the table row structure for a single field.
protected array
buildExtraFieldRow(string $field_id, array $extra_field)
Builds the table row structure for a single extra field.
multistepSubmit($form, FormStateInterface $form_state)
Form submission handler for multistep buttons.
multistepAjax($form, FormStateInterface $form_state)
Ajax handler for multistep buttons.
array
tablePreRender(array $elements)
deprecated
deprecated
Performs pre-render tasks on field_ui_table elements.
reduceOrder($array, $a)
deprecated
deprecated
Determines the rendering order of an array representing a tree.
Callback for array_reduce() within \Drupal\field_ui\Form\EntityDisplayFormBase::tablePreRender().
protected array
getExtraFields()
Returns the extra fields of the entity type and bundle used by this form.
protected EntityDisplayInterface
getEntityDisplay(string $entity_type_id, string $bundle, string $mode)
Returns an entity display object to be used by this form.
protected array
getApplicablePluginOptions(FieldDefinitionInterface $field_definition)
Returns an array of applicable widget or formatter options for a field.
protected string
getDefaultPlugin(string $field_type)
Returns the ID of the default widget or formatter plugin for a field type.
protected array
getDisplayModes()
Returns the form or view modes used by this form.
protected array
getDisplayModeOptions()
Returns an array of form or view mode options.
protected array
getDisplayModesLink()
Returns a link to the form or view mode admin page.
string|null
getRowRegion(array $row)
Returns the region to which a row in the display overview belongs.
protected EntityDisplayInterface[]
getDisplays()
Returns entity (form) displays for the current entity display type.
protected array
getDisplayStatuses()
Returns form or view modes statuses for the bundle used by this form.
protected
saveDisplayStatuses(array $display_statuses)
Saves the updated display mode statuses.
protected array
getTableHeader()
Returns an array containing the table headers.
protected Url
getOverviewUrl(string $mode)
Returns the Url object for a specific entity (form) display edit form.
protected array
thirdPartySettingsForm(PluginSettingsInterface $plugin, FieldDefinitionInterface $field_definition, array $form, FormStateInterface $form_state)
Adds the widget or formatter third party settings forms.
protected
alterSettingsSummary(array $summary, PluginSettingsInterface $plugin, FieldDefinitionInterface $field_definition)
Alters the widget or formatter settings summary.
protected array
getFieldLabelOptions()
Returns an array of visibility options for field labels.
protected LayoutInterface
getLayout(EntityDisplayWithLayoutInterface $entity, FormStateInterface $form_state)
Gets the layout plugin for the currently selected field layout.
static
settingsAjax($form, FormStateInterface $form_state)
Ajax callback for the field layout settings form.
settingsAjaxSubmit($form, FormStateInterface $form_state)
Submit handler for the non-JS case.