EntityFormMode.php 1.45 KB
Newer Older
1 2
<?php

3
namespace Drupal\Core\Entity\Entity;
4

5 6
use Drupal\Core\Entity\EntityDisplayModeBase;
use Drupal\Core\Entity\EntityFormModeInterface;
7 8

/**
9
 * Defines the entity form mode configuration entity class.
10 11 12 13 14 15 16 17 18 19 20 21
 *
 * 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.
 *
22 23
 * @see \Drupal\Core\Entity\EntityManagerInterface::getAllFormModes()
 * @see \Drupal\Core\Entity\EntityManagerInterface::getFormModes()
24
 *
25
 * @ConfigEntityType(
26
 *   id = "entity_form_mode",
27 28 29
 *   label = @Translation("Form mode"),
 *   entity_keys = {
 *     "id" = "id",
30
 *     "label" = "label"
31 32 33 34 35 36
 *   },
 *   config_export = {
 *     "id",
 *     "label",
 *     "targetEntityType",
 *     "cache",
37 38 39 40 41 42
 *   }
 * )
 */
class EntityFormMode extends EntityDisplayModeBase implements EntityFormModeInterface {

}