class EntityFormMode
Same name in other branches
- 9 core/lib/Drupal/Core/Entity/Entity/EntityFormMode.php \Drupal\Core\Entity\Entity\EntityFormMode
- 8.9.x core/lib/Drupal/Core/Entity/Entity/EntityFormMode.php \Drupal\Core\Entity\Entity\EntityFormMode
- 10 core/lib/Drupal/Core/Entity/Entity/EntityFormMode.php \Drupal\Core\Entity\Entity\EntityFormMode
Defines the entity form mode configuration entity class.
Form modes allow entity forms to be displayed differently depending on the context. For instance, the user entity form can be displayed with a set of fields on the 'profile' page (user edit page) and with a different set of fields (or settings) on the user registration page. Modules taking part in the display of the entity form (notably the Field API) can adjust their behavior depending on the requested form mode. An additional 'default' form mode is available for all entity types. For each available form mode, administrators can configure whether it should use its own set of field display settings, or just replicate the settings of the 'default' form mode, thus reducing the amount of form display configurations to keep track of.
Plugin annotation
@ConfigEntityType(
id = "entity_form_mode",
label = @Translation("Form mode"),
entity_keys = {
"id" = "id",
"label" = "label",
"description" = "description",
},
config_export = {
"id",
"label",
"description",
"targetEntityType",
"cache",
},
constraints = {
"ImmutableProperties" = {"id", "targetEntityType"},
}
)
Hierarchy
- class \Drupal\Core\Entity\EntityBase implements \Drupal\Core\Entity\EntityInterface uses \Drupal\Core\Cache\RefinableCacheableDependencyTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait
- class \Drupal\Core\Config\Entity\ConfigEntityBase extends \Drupal\Core\Entity\EntityBase implements \Drupal\Core\Config\Entity\ConfigEntityInterface uses \Drupal\Core\Plugin\PluginDependencyTrait, \Drupal\Core\Entity\SynchronizableEntityTrait
- class \Drupal\Core\Entity\EntityDisplayModeBase extends \Drupal\Core\Config\Entity\ConfigEntityBase implements \Drupal\Core\Entity\EntityDisplayModeInterface
- class \Drupal\Core\Entity\Entity\EntityFormMode extends \Drupal\Core\Entity\EntityDisplayModeBase implements \Drupal\Core\Entity\EntityFormModeInterface
- class \Drupal\Core\Entity\EntityDisplayModeBase extends \Drupal\Core\Config\Entity\ConfigEntityBase implements \Drupal\Core\Entity\EntityDisplayModeInterface
- class \Drupal\Core\Config\Entity\ConfigEntityBase extends \Drupal\Core\Entity\EntityBase implements \Drupal\Core\Config\Entity\ConfigEntityInterface uses \Drupal\Core\Plugin\PluginDependencyTrait, \Drupal\Core\Entity\SynchronizableEntityTrait
Expanded class hierarchy of EntityFormMode
See also
\Drupal\Core\Entity\EntityDisplayRepositoryInterface::getAllFormModes()
\Drupal\Core\Entity\EntityDisplayRepositoryInterface::getFormModes()
14 files declare their use of EntityFormMode
- DisplayModeBundleSelectionTest.php in core/
modules/ field_ui/ tests/ src/ FunctionalJavascript/ DisplayModeBundleSelectionTest.php - DisplayModeUpdateTest.php in core/
modules/ field/ tests/ src/ Kernel/ DisplayModeUpdateTest.php - EntityDisplayModeTest.php in core/
modules/ field_ui/ tests/ src/ Functional/ EntityDisplayModeTest.php - EntityFormDisplayTest.php in core/
modules/ field_ui/ tests/ src/ Kernel/ EntityFormDisplayTest.php - EntityFormDisplayValidationTest.php in core/
tests/ Drupal/ KernelTests/ Core/ Entity/ EntityFormDisplayValidationTest.php
File
-
core/
lib/ Drupal/ Core/ Entity/ Entity/ EntityFormMode.php, line 45
Namespace
Drupal\Core\Entity\EntityView source
class EntityFormMode extends EntityDisplayModeBase implements EntityFormModeInterface {
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.