class FlexiformEntityFormDisplay in Flexiform 8
Defines a class to extend EntityFormDisplays.
To work with multiple entity forms.
Hierarchy
- class \Drupal\Core\Entity\EntityBase implements EntityInterface uses RefinableCacheableDependencyTrait, DependencySerializationTrait- class \Drupal\Core\Config\Entity\ConfigEntityBase implements ConfigEntityInterface uses SynchronizableEntityTrait, PluginDependencyTrait- class \Drupal\Core\Entity\EntityDisplayBase implements EntityDisplayInterface- class \Drupal\Core\Entity\Entity\EntityFormDisplay implements EntityFormDisplayInterface- class \Drupal\flexiform\FlexiformEntityFormDisplay implements FlexiformEntityFormDisplayInterface
 
 
- class \Drupal\Core\Entity\Entity\EntityFormDisplay implements EntityFormDisplayInterface
 
- class \Drupal\Core\Entity\EntityDisplayBase implements EntityDisplayInterface
 
- class \Drupal\Core\Config\Entity\ConfigEntityBase implements ConfigEntityInterface uses SynchronizableEntityTrait, PluginDependencyTrait
Expanded class hierarchy of FlexiformEntityFormDisplay
9 files declare their use of FlexiformEntityFormDisplay
- ContainerFactoryFormComponentInterface.php in src/FormComponent/ ContainerFactoryFormComponentInterface.php 
- CustomTextComponent.php in src/Plugin/ FormComponentType/ CustomTextComponent.php 
- EntityFormBlockDeriver.php in src/Plugin/ Deriver/ EntityFormBlockDeriver.php 
- FieldWidgetComponent.php in src/Plugin/ FormComponentType/ FieldWidgetComponent.php 
- flexiform.module in ./flexiform.module 
- Allow multiple entities to be used in an entity form display.
File
- src/FlexiformEntityFormDisplay.php, line 21 
Namespace
Drupal\flexiformView source
class FlexiformEntityFormDisplay extends EntityFormDisplay implements FlexiformEntityFormDisplayInterface {
  /**
   * The base entity namespace.
   *
   * @var string
   */
  protected $baseEntityNamespace = '';
  /**
   * The form entity configuration.
   *
   * @var array
   */
  protected $formEntities = [];
  /**
   * The form enhancers.
   *
   * @var array
   */
  protected $formEnhancers = [];
  /**
   * The flexiform form Entity Manager.
   *
   * @var \Drupal\flexiform\FormEntity\FlexiformFormEntityManager
   */
  protected $formEntityManager;
  /**
   * What entities the form entity manager has been provided with.
   *
   * If more entities are supplied build a new entity manager.
   *
   * @var string[]
   */
  protected $formEntityManagerSuppliedNamespaces;
  /**
   * Component types.
   *
   * @var \Drupal\flexiform\FormComponent\FormComponentTypeInterface[]
   */
  protected $componentTypePlugins = [];
  protected $providedEntities = [];
  /**
   * Collect the render display for a given entity_type_id and bundle.
   *
   * @param string $entity_type
   *   The entity type id.
   * @param $bundle
   * @param $form_mode
   *
   * @return \Drupal\Core\Entity\Display\EntityFormDisplayInterface
   */
  public static function collectRenderDisplayLight($entity_type, $bundle, $form_mode) {
    // Check the existence and status of:
    // - the display for the form mode,
    // - the 'default' display.
    if ($form_mode != 'default') {
      $candidate_ids[] = $entity_type . '.' . $bundle . '.' . $form_mode;
    }
    $candidate_ids[] = $entity_type . '.' . $bundle . '.default';
    $results = \Drupal::entityQuery('entity_form_display')
      ->condition('id', $candidate_ids)
      ->condition('status', TRUE)
      ->execute();
    // Load the first valid candidate display, if any.
    $storage = \Drupal::entityManager()
      ->getStorage('entity_form_display');
    foreach ($candidate_ids as $candidate_id) {
      if (isset($results[$candidate_id])) {
        $display = $storage
          ->load($candidate_id);
        break;
      }
    }
    // Else create a fresh runtime object.
    if (empty($display)) {
      $display = $storage
        ->create([
        'targetEntityType' => $entity_type,
        'bundle' => $bundle,
        'mode' => $form_mode,
        'status' => TRUE,
      ]);
    }
    // Let the display know which form mode was originally requested.
    $display->originalMode = $form_mode;
    // Let modules alter the display.
    $display_context = [
      'entity_type' => $entity_type,
      'bundle' => $bundle,
      'form_mode' => $form_mode,
    ];
    \Drupal::moduleHandler()
      ->alter('entity_form_display', $display, $display_context);
    return $display;
  }
  /**
   * Get the regions needed to create the overview form.
   *
   * I don't understand why in core these two methods are on the form_object
   * rather than the EntityFormDisplay object itself. I have put them here
   * so that it's easier to get access to the correct regions.
   *
   * @see \Drupal\field_ui\Form\EntityDisplayFormBase::getRegions()
   *
   * @return array
   *   Example usage:
   *
   * @code
   *     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.'),
   *       ),
   *     );
   * @endcode
   */
  public function getRegions() {
    return [
      'content' => [
        'title' => t('Content'),
        'invisible' => TRUE,
        'message' => t('No component is displayed.'),
      ],
      'hidden' => [
        'title' => t('Disabled', [], [
          'context' => 'Plural',
        ]),
        'message' => t('No component is hidden.'),
      ],
    ];
  }
  /**
   * Returns an associative array of all regions.
   *
   * @return array
   *   An array containing the region options.
   *
   * @see \Drupal\field_ui\Form\EntityDisplayFormBase::getRegionOptions()
   */
  public function getRegionOptions() {
    $options = [];
    foreach ($this
      ->getRegions() as $region => $data) {
      $options[$region] = $data['title'];
    }
    return $options;
  }
  /**
   * {@inheritdoc}
   */
  public function preSave(EntityStorageInterface $storage, $update = TRUE) {
    // Allow syncing to change the settings.
    $enhancer_settings = $this
      ->getThirdPartySetting('flexiform', 'enhancer', []);
    foreach ($this->formEnhancers as $enhancer_name => $enhancer) {
      if ($enhancer instanceof ConfigurableFormEnhancerInterface) {
        // If we're syncing, update the enhancer.
        if ($this
          ->isSyncing()) {
          if (isset($enhancer_settings[$enhancer_name])) {
            $enhancer
              ->setConfiguration($enhancer_settings[$enhancer_name]);
          }
        }
        else {
          $config = $enhancer
            ->getConfiguration();
          $config['id'] = $enhancer
            ->getPluginId();
          $enhancer_settings[$enhancer_name] = $config;
        }
      }
    }
    // If not syncing, write our changes.
    if (!$this
      ->isSyncing()) {
      $this
        ->setThirdPartySetting('flexiform', 'enhancer', $enhancer_settings);
    }
    parent::preSave($storage, $update);
  }
  /**
   * {@inheritdoc}
   */
  public static function postLoad(EntityStorageInterface $storage, array &$entities) {
    foreach ($entities as $entity) {
      $entity
        ->initFormEntityConfig();
    }
    parent::postLoad($storage, $entities);
  }
  /**
   * Get the component plugin.
   *
   * @return \Drupal\flexiform\FormComponent\FormComponentInterface
   */
  public function getComponentPlugin($name, $options, FlexiformFormEntityManager $form_entity_manager) {
    $plugin_id = !empty($options['component_type']) ? $options['component_type'] : (empty($options['type']) ? 'extra_field' : 'field_widget');
    return $this
      ->getComponentTypePlugin($plugin_id, $form_entity_manager)
      ->getComponent($name, $options)
      ->setFormEntityManager($form_entity_manager);
  }
  /**
   * Get a compoenet type plugin.
   */
  public function getComponentTypePlugin($plugin_id, FlexiformFormEntityManager $formEntityManager) {
    if (empty($this->componentTypePlugins[$plugin_id])) {
      $this->componentTypePlugins[$plugin_id] = \Drupal::service('plugin.manager.flexiform.form_component_type')
        ->createInstance($plugin_id)
        ->setFormDisplay($this);
      if ($formEntityManager) {
        $this->componentTypePlugins[$plugin_id]
          ->setFormEntityManager($formEntityManager);
      }
    }
    return $this->componentTypePlugins[$plugin_id];
  }
  /**
   * Get the array of provided entities.
   */
  protected function getProvidedEntities(FormStateInterface $form_state, FieldableEntityInterface $base_entity = NULL) {
    $provided = [];
    if ($base_entity) {
      $provided[$this->baseEntityNamespace] = $base_entity;
    }
    $provided += $form_state
      ->get('form_entity_provided') ?: [];
    return $provided;
  }
  /**
   * {@inheritdoc}
   */
  public function buildForm(FieldableEntityInterface $entity, array &$form, FormStateInterface $form_state) {
    $this
      ->buildAdvancedForm($this
      ->getProvidedEntities($form_state, $entity), $form, $form_state);
  }
  /**
   * Build standalone form.
   *
   * A standalone form does not have a single base.
   * This allows the passing of a single array of provided entities.
   *
   * @param \Drupal\Core\Entity\FieldableEntityInterface[] $provided
   *   An array of provided entities keyed by namespace.
   * @param array $form
   *   The form array.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The form state.
   */
  public function buildAdvancedForm(array $provided, array &$form, FormStateInterface $form_state) {
    // Set #parents to 'top-level' by default.
    $form += [
      '#parents' => [],
      '#array_parents' => [],
    ];
    $original_parents = $form['#parents'];
    $form_state = $this
      ->decorateFormState($form, $form_state);
    $this
      ->getFormEntityManager($form_state, $provided);
    // Let each widget generate the form elements.
    foreach ($this
      ->getComponents() as $name => $options) {
      $component = $this
        ->getComponentPlugin($name, $options, $form_state
        ->getFormEntityManager());
      // On each component reset the parents back to the original.
      $form['#parents'] = $original_parents;
      $component
        ->render($form, $form_state, $this->renderer);
    }
    // Set form parents back to the original.
    $form['#parents'] = $original_parents;
    // Associate the cache tags for the form display.
    $this->renderer
      ->addCacheableDependency($form, $this);
    // Add a process callback so we can assign weights and hide extra fields.
    $form['#process'][] = [
      $this,
      'processForm',
    ];
  }
  /**
   * {@inheritdoc}
   */
  public function processForm($element, FormStateInterface $form_state, $form) {
    $element = parent::processForm($element, $form_state, $form);
    foreach ($this
      ->getFormEnhancers('process_form') as $enhancer) {
      $element = $enhancer
        ->processForm($element, $form_state, $form);
    }
    static::addSaveFormEntitiesSubmit($element, $this);
    return $element;
  }
  /**
   * {@inheritdoc}
   */
  public function extractFormValues(FieldableEntityInterface $entity, array &$form, FormStateInterface $form_state) {
    // Make sure the form entity manager is appropriately constructed.
    $extracted = [];
    $form_state = $this
      ->decorateFormState($form, $form_state);
    $this
      ->getFormEntityManager($form_state, $this
      ->getProvidedEntities($form_state, $entity), TRUE);
    foreach ($this
      ->getComponents() as $name => $options) {
      if (($component = $this
        ->getComponentPlugin($name, $options, $form_state
        ->getFormEntityManager())) && !empty($form[$name])) {
        $component
          ->extractFormValues($form[$name], $form_state);
        $extracted[$name] = $name;
      }
    }
    return $extracted;
  }
  /**
   * {@inheritdoc}
   */
  public function formValidateComponents(array $form, FormStateInterface $form_state) {
    $form_state = $this
      ->decorateFormState($form, $form_state);
    foreach ($this
      ->getComponents() as $name => $options) {
      if ($component = $this
        ->getComponentPlugin($name, $options, $form_state
        ->getFormEntityManager())) {
        if ($component instanceof FormComponentWithValidateInterface) {
          $component
            ->formValidate($form[$name], $form_state);
        }
      }
    }
  }
  /**
   * {@inheritdoc}
   */
  public function formSubmitComponents(array $form, FormStateInterface $form_state) {
    $form_state = $this
      ->decorateFormState($form, $form_state);
    foreach ($this
      ->getComponents() as $name => $options) {
      if ($component = $this
        ->getComponentPlugin($name, $options, $form_state
        ->getFormEntityManager())) {
        if ($component instanceof FormComponentWithSubmitInterface) {
          $component
            ->formSubmit($form[$name], $form_state);
        }
      }
    }
  }
  /**
   * Save the extra entities added to the form.
   */
  public function saveFormEntities(array $form, FormStateInterface $form_state) {
    $form_state = $this
      ->decorateFormState($form, $form_state);
    $form_state
      ->getFormEntityManager()
      ->saveFormEntities();
  }
  /**
   * Look through the form to find submit buttons.
   *
   * If they have the save submit method then add our saveEntities submit
   * callback.
   *
   * @param array $element
   *   The element to add the submit callback to. If this is not a submit
   *   element then continue to search the children.
   * @param \Drupal\flexiform\FlexiformEntityFormDisplayInterface $form_display
   *   The flexiform entity form display.
   *
   * @todo: Move onto the multiple_entities enhancer plugin.
   */
  public static function addSaveFormEntitiesSubmit(array &$element, FlexiformEntityFormDisplayInterface $form_display) {
    if (isset($element['#type']) && $element['#type'] == 'submit') {
      if (!empty($element['#submit']) && in_array('::save', $element['#submit'])) {
        $new_submit = [];
        // Add extra submit handlers to all buttons on the form.
        // This includes adding a formSubmitComponents callback to allow
        // components to have their own submission logic. This applies
        // BEFORE the entities are saved.
        // Also add the 'saveFormEntities' callback immediatly after the
        // standard '::save'.
        foreach ($element['#submit'] as $callback) {
          if ($callback == '::save') {
            $new_submit[] = [
              $form_display,
              'formSubmitComponents',
            ];
          }
          $new_submit[] = $callback;
          if ($callback == '::save') {
            $new_submit[] = [
              $form_display,
              'saveFormEntities',
            ];
          }
        }
        $element['#submit'] = $new_submit;
      }
      if (!empty($element['#validate'])) {
        // Add extra validate handler to all buttons on the form.
        // This allows form components to have their own validation logic.
        $element['#validate'][] = [
          $form_display,
          'formValidateComponents',
        ];
      }
    }
    else {
      foreach (Element::children($element) as $key) {
        FlexiformEntityFormDisplay::addSaveFormEntitiesSubmit($element[$key], $form_display);
      }
    }
  }
  /**
   * {@inheritdoc}
   */
  public function getFormEntityConfig() {
    $this
      ->initFormEntityConfig();
    return $this->formEntities;
  }
  /**
   * {@inheritdoc}
   */
  public function initFormEntityConfig() {
    if (empty($this->formEntities)) {
      $this->formEntities = [];
      $form_entities = [];
      foreach ($this
        ->getFormEnhancers('init_form_entity_config') as $enhancer) {
        $form_entities += $enhancer
          ->initFormEntityConfig();
      }
      // If there is a base entity add it to the configuration.
      if ($this
        ->getTargetEntityTypeId() && empty($form_entities[$this->baseEntityNamespace])) {
        $this->formEntities[$this->baseEntityNamespace] = [
          'entity_type' => $this
            ->getTargetEntityTypeId(),
          'bundle' => $this
            ->getTargetBundle(),
          'plugin' => 'provided',
          'label' => t('Base @entity_type', [
            '@entity_type' => \Drupal::service('entity_type.manager')
              ->getDefinition($this
              ->getTargetEntityTypeId())
              ->getLabel(),
          ]),
        ];
      }
      $this->formEntities += $form_entities;
    }
  }
  /**
   * Get the form entity manager.
   *
   * @param FormStateInterface $form_state
   * @param \Drupal\Core\Entity\FieldableEntityInterface[] $provided
   *   Provided entities to this entity manager.
   * @param bool $reset
   *   If TRUE always create a new form entity manager.
   *
   * @return \Drupal\flexiform\FormEntity\FlexiformFormEntityManager
   *   The form entity manager.
   */
  public function getFormEntityManager(MultipleEntityFormStateInterface $form_state, array $provided = [], $reset = FALSE) {
    $provided += $this->providedEntities;
    $this->providedEntities = $provided;
    if (!$form_state
      ->getFormEntityManager() || $reset) {
      $form_state
        ->setFormEntityManager(new FlexiformFormEntityManager($this, $provided));
    }
    return $form_state
      ->getFormEntityManager();
  }
  /**
   * Get the enhancers for this form display.
   *
   * @param string $event
   *   Optionally filter the enhancers by an applicable event.
   *
   * @return \Drupal\flexiform\FormEnhancer\FormEnhancerInterface[]
   *   An array of form enhancers/
   */
  public function getFormEnhancers($event = NULL) {
    if (empty($this->formEnhancers)) {
      $enhancer_settings = $this
        ->getThirdPartySetting('flexiform', 'enhancer', []);
      $enhancer_definitions = \Drupal::service('plugin.manager.flexiform.form_enhancer')
        ->getDefinitions();
      foreach ($enhancer_definitions as $plugin_id => $definition) {
        $this->formEnhancers[$plugin_id] = \Drupal::service('plugin.manager.flexiform.form_enhancer')
          ->createInstance($plugin_id, isset($enhancer_settings[$plugin_id]) ? $enhancer_settings[$plugin_id] : [])
          ->setFormDisplay($this);
      }
    }
    if (is_null($event)) {
      return $this->formEnhancers;
    }
    $applicable_enhancer_names = [];
    foreach ($this->formEnhancers as $plugin_id => $enhancer) {
      if (($weight = $enhancer
        ->applies($event)) !== FALSE) {
        $applicable_enhancer_names[$plugin_id] = $weight;
      }
    }
    asort($applicable_enhancer_names);
    $applicable_enhancers = [];
    foreach ($applicable_enhancer_names as $plugin_id => $weight) {
      $applicable_enhancers[$plugin_id] = $this->formEnhancers[$plugin_id];
    }
    return $applicable_enhancers;
  }
  /**
   * Get a particular form enhancer.
   *
   * @param string $enhancer_name
   *   The form enhancer name.
   *
   * @return \Drupal\flexiform\FormEnhancer\FormEnhancerInterface
   *   The form enhancer.
   */
  public function getFormEnhancer($enhancer_name) {
    if (empty($this->formEnhancers)) {
      $this
        ->getFormEnhancers();
    }
    return isset($this->formEnhancers[$enhancer_name]) ? $this->formEnhancers[$enhancer_name] : NULL;
  }
  /**
   * Get the entity form builder.
   *
   * This is designed to be helpful for enhancers that want to inspect the
   * resultant form before providing configuration options.
   *
   * @return array
   *   An array with two keys:
   *   - form_object: \Drupal\Core\Form\FormBase
   *   - form_state: \Drupal\Core\Form\FormStateInterface
   *   - form: array
   */
  public function getFormInformation() {
    $operation = $this
      ->get('originalMode') ?: $this
      ->get('mode');
    $form_object = \Drupal::service('flexiform.manager')
      ->getFormObject($this);
    $default_values = [];
    if ($bundle_key = $this
      ->entityTypeManager()
      ->getDefinition($this
      ->getTargetEntityTypeId())
      ->getKey('bundle')) {
      $default_values[$bundle_key] = $this
        ->getTargetBundle();
    }
    $form_object
      ->setEntity($this
      ->entityTypeManager()
      ->getStorage($this
      ->getTargetEntityTypeId())
      ->create($default_values));
    $form_state = new FormState();
    return [
      'form_object' => $form_object,
      'form_state' => $form_state,
      'form' => \Drupal::service('form_builder')
        ->buildForm($form_object, $form_state),
    ];
  }
  /**
   * Get the base entity namespace.
   *
   * @return string
   *   The base entity namespace.
   */
  public function getBaseEntityNamespace() {
    return $this->baseEntityNamespace;
  }
  /**
   * Decorate the form state when required.
   *
   * @param array $form
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *
   * @return \Drupal\flexiform\MultipleEntityFormStateInterface
   */
  protected function decorateFormState(array &$form, FormStateInterface $form_state) {
    return MultipleEntityFormState::createForForm($form, $form_state);
  }
}Members
| Name   | Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| CacheableDependencyTrait:: | protected | property | Cache contexts. | |
| CacheableDependencyTrait:: | protected | property | Cache max-age. | |
| CacheableDependencyTrait:: | protected | property | Cache tags. | |
| CacheableDependencyTrait:: | protected | function | Sets cacheability; useful for value object constructors. | |
| ConfigEntityBase:: | private | property | Whether the config is being deleted by the uninstall process. | |
| ConfigEntityBase:: | protected | property | The language code of the entity's default language. | |
| ConfigEntityBase:: | protected | property | The original ID of the configuration entity. | |
| ConfigEntityBase:: | protected | property | Third party entity settings. | |
| ConfigEntityBase:: | protected | property | Trust supplied data and not use configuration schema on save. | |
| ConfigEntityBase:: | protected | property | The UUID for this entity. | |
| ConfigEntityBase:: | protected | property | Information maintained by Drupal core about configuration. | |
| ConfigEntityBase:: | protected | function | Overrides \Drupal\Core\Entity\DependencyTrait:addDependency(). | |
| ConfigEntityBase:: | public | function | Creates a duplicate of the entity. Overrides EntityBase:: | 1 | 
| ConfigEntityBase:: | public | function | Disables the configuration entity. Overrides ConfigEntityInterface:: | 1 | 
| ConfigEntityBase:: | public | function | Enables the configuration entity. Overrides ConfigEntityInterface:: | |
| ConfigEntityBase:: | public | function | Returns the value of a property. Overrides ConfigEntityInterface:: | |
| ConfigEntityBase:: | public | function | Returns the cache tags that should be used to invalidate caches. Overrides EntityBase:: | 1 | 
| ConfigEntityBase:: | public | function | Gets the configuration dependency name. Overrides EntityBase:: | |
| ConfigEntityBase:: | protected static | function | Gets the configuration manager. | |
| ConfigEntityBase:: | public | function | Gets the configuration target identifier for the entity. Overrides EntityBase:: | |
| ConfigEntityBase:: | public | function | Gets the configuration dependencies. Overrides ConfigEntityInterface:: | |
| ConfigEntityBase:: | public | function | Gets the original ID. Overrides EntityBase:: | |
| ConfigEntityBase:: | public | function | Gets the list of third parties that store information. Overrides ThirdPartySettingsInterface:: | |
| ConfigEntityBase:: | public | function | Gets the value of a third-party setting. Overrides ThirdPartySettingsInterface:: | |
| ConfigEntityBase:: | public | function | Gets all third-party settings of a given module. Overrides ThirdPartySettingsInterface:: | |
| ConfigEntityBase:: | protected | function | Gets the typed config manager. | |
| ConfigEntityBase:: | public | function | Gets whether on not the data is trusted. Overrides ConfigEntityInterface:: | |
| ConfigEntityBase:: | protected static | function | Override to never invalidate the individual entities' cache tags; the
config system already invalidates them. Overrides EntityBase:: | |
| ConfigEntityBase:: | protected | function | Override to never invalidate the entity's cache tag; the config system
already invalidates it. Overrides EntityBase:: | |
| ConfigEntityBase:: | public | function | Checks whether this entity is installable. Overrides ConfigEntityInterface:: | 2 | 
| ConfigEntityBase:: | public | function | Overrides Entity::isNew(). Overrides EntityBase:: | |
| ConfigEntityBase:: | public | function | Returns whether this entity is being changed during the uninstall process. Overrides ConfigEntityInterface:: | |
| ConfigEntityBase:: | public | function | Deprecated way of generating a link to the entity. See toLink(). Overrides EntityBase:: | |
| ConfigEntityBase:: | public static | function | Acts on entities before they are deleted and before hooks are invoked. Overrides EntityBase:: | 8 | 
| ConfigEntityBase:: | public | function | Saves an entity permanently. Overrides EntityBase:: | 1 | 
| ConfigEntityBase:: | public | function | Sets the value of a property. Overrides ConfigEntityInterface:: | |
| ConfigEntityBase:: | public | function | Sets the original ID. Overrides EntityBase:: | |
| ConfigEntityBase:: | public | function | Sets the status of the configuration entity. Overrides ConfigEntityInterface:: | |
| ConfigEntityBase:: | public | function | Sets the value of a third-party setting. Overrides ThirdPartySettingsInterface:: | |
| ConfigEntityBase:: | public | function | ||
| ConfigEntityBase:: | public static | function | Helper callback for uasort() to sort configuration entities by weight and label. | 6 | 
| ConfigEntityBase:: | public | function | Returns whether the configuration entity is enabled. Overrides ConfigEntityInterface:: | 4 | 
| ConfigEntityBase:: | public | function | Gets the URL object for the entity. Overrides EntityBase:: | |
| ConfigEntityBase:: | public | function | Sets that the data should be trusted. Overrides ConfigEntityInterface:: | |
| ConfigEntityBase:: | public | function | Unsets a third-party setting. Overrides ThirdPartySettingsInterface:: | |
| ConfigEntityBase:: | public | function | Gets the public URL for this entity. Overrides EntityBase:: | |
| ConfigEntityBase:: | public | function | Gets the URL object for the entity. Overrides EntityBase:: | |
| DependencySerializationTrait:: | protected | property | An array of entity type IDs keyed by the property name of their storages. | |
| DependencySerializationTrait:: | protected | property | An array of service IDs keyed by property name used for serialization. | |
| DependencySerializationTrait:: | public | function | Aliased as: traitSleep | 1 | 
| DependencyTrait:: | protected | property | The object's dependencies. | |
| DependencyTrait:: | protected | function | Adds multiple dependencies. | |
| DependencyTrait:: | protected | function | Adds a dependency. Aliased as: addDependencyTrait | |
| EntityBase:: | protected | property | Boolean indicating whether the entity should be forced to be new. | |
| EntityBase:: | protected | property | The entity type. | |
| EntityBase:: | protected | property | A typed data object wrapping this entity. | |
| EntityBase:: | public | function | Checks data value access. Overrides AccessibleInterface:: | 1 | 
| EntityBase:: | public | function | Gets the bundle of the entity. Overrides EntityInterface:: | 1 | 
| EntityBase:: | public static | function | Constructs a new entity object, without permanently saving it. Overrides EntityInterface:: | |
| EntityBase:: | public | function | Deletes an entity permanently. Overrides EntityInterface:: | 2 | 
| EntityBase:: | public | function | Enforces an entity to be new. Overrides EntityInterface:: | |
| EntityBase:: | protected | function | Gets the entity manager. | |
| EntityBase:: | protected | function | Gets the entity type bundle info service. | |
| EntityBase:: | protected | function | Gets the entity type manager. | |
| EntityBase:: | public | function | The cache contexts associated with this object. Overrides CacheableDependencyTrait:: | |
| EntityBase:: | public | function | The maximum age for which this object may be cached. Overrides CacheableDependencyTrait:: | |
| EntityBase:: | public | function | The cache tags associated with this object. Overrides CacheableDependencyTrait:: | |
| EntityBase:: | public | function | Gets the key that is used to store configuration dependencies. Overrides EntityInterface:: | |
| EntityBase:: | public | function | Gets the entity type definition. Overrides EntityInterface:: | |
| EntityBase:: | public | function | Gets the ID of the type of the entity. Overrides EntityInterface:: | |
| EntityBase:: | protected | function | The list cache tags to invalidate for this entity. | |
| EntityBase:: | public | function | Gets a typed data object for this entity object. Overrides EntityInterface:: | |
| EntityBase:: | public | function | Indicates if a link template exists for a given key. Overrides EntityInterface:: | |
| EntityBase:: | public | function | Gets the label of the entity. Overrides EntityInterface:: | 6 | 
| EntityBase:: | public | function | Gets the language of the entity. Overrides EntityInterface:: | 1 | 
| EntityBase:: | protected | function | Gets the language manager. | |
| EntityBase:: | protected | function | Gets an array link templates. | 1 | 
| EntityBase:: | public static | function | Loads an entity. Overrides EntityInterface:: | |
| EntityBase:: | public static | function | Loads one or more entities. Overrides EntityInterface:: | |
| EntityBase:: | public | function | Acts on a created entity before hooks are invoked. Overrides EntityInterface:: | 4 | 
| EntityBase:: | public static | function | Acts on deleted entities before the delete hook is invoked. Overrides EntityInterface:: | 16 | 
| EntityBase:: | public | function | Acts on a saved entity before the insert or update hook is invoked. Overrides EntityInterface:: | 14 | 
| EntityBase:: | public static | function | Changes the values of an entity before it is created. Overrides EntityInterface:: | 5 | 
| EntityBase:: | public | function | Gets a list of entities referenced by this entity. Overrides EntityInterface:: | 1 | 
| EntityBase:: | public | function | Generates the HTML for a link to this entity. Overrides EntityInterface:: | |
| EntityBase:: | public | function | Gets a list of URI relationships supported by this entity. Overrides EntityInterface:: | |
| EntityBase:: | protected | function | Gets an array of placeholders for this entity. | 2 | 
| EntityBase:: | public | function | Gets the entity UUID (Universally Unique Identifier). Overrides EntityInterface:: | 1 | 
| EntityBase:: | protected | function | Gets the UUID generator. | |
| EntityDisplayBase:: | protected | property | Bundle to be displayed. | |
| EntityDisplayBase:: | protected | property | List of component display options, keyed by component name. | |
| EntityDisplayBase:: | protected | property | A list of field definitions eligible for configuration in this display. | |
| EntityDisplayBase:: | protected | property | List of components that are set to be hidden. | |
| EntityDisplayBase:: | protected | property | Unique ID for the config entity. | |
| EntityDisplayBase:: | protected | property | View or form mode to be displayed. | |
| EntityDisplayBase:: | protected | property | The original view or form mode that was requested (case of view/form modes being configured to fall back to the 'default' display). | |
| EntityDisplayBase:: | protected | property | The plugin manager used by this entity type. | |
| EntityDisplayBase:: | protected | property | The plugin objects used for this display, keyed by field name. | |
| EntityDisplayBase:: | protected | property | The renderer. | |
| EntityDisplayBase:: | protected | property | Whether this display is enabled or not. If the entity (form) display
is disabled, we'll fall back to the 'default' display. Overrides ConfigEntityBase:: | |
| EntityDisplayBase:: | protected | property | Entity type to be displayed. | |
| EntityDisplayBase:: | public | function | Calculates dependencies and stores them in the dependency property. Overrides ConfigEntityBase:: | 1 | 
| EntityDisplayBase:: | public | function | Creates a duplicate of the entity display object on a different view mode. Overrides EntityDisplayInterface:: | 1 | 
| EntityDisplayBase:: | constant | The 'mode' for runtime EntityDisplay objects used to render entities with arbitrary display options rather than a configured view mode or form mode. | ||
| EntityDisplayBase:: | private | function | Determines if a field has options for a given display. | |
| EntityDisplayBase:: | public | function | Gets the display options set for a component. Overrides EntityDisplayInterface:: | 1 | 
| EntityDisplayBase:: | public | function | Gets the display options for all components. Overrides EntityDisplayInterface:: | |
| EntityDisplayBase:: | protected | function | Gets the default region. | 1 | 
| EntityDisplayBase:: | protected | function | Gets the field definition of a field. | |
| EntityDisplayBase:: | protected | function | Gets the definitions of the fields that are candidate for display. | |
| EntityDisplayBase:: | public | function | Gets the highest weight of the components in the display. Overrides EntityDisplayInterface:: | |
| EntityDisplayBase:: | protected | function | Provides the 'system' channel logger service. | |
| EntityDisplayBase:: | public | function | Gets the view or form mode to be displayed. Overrides EntityDisplayInterface:: | |
| EntityDisplayBase:: | public | function | Gets the original view or form mode that was requested. Overrides EntityDisplayInterface:: | |
| EntityDisplayBase:: | protected | function | Returns the plugin dependencies being removed. | |
| EntityDisplayBase:: | public | function | Gets the bundle to be displayed. Overrides EntityDisplayInterface:: | |
| EntityDisplayBase:: | public | function | Gets the entity type for which this display is used. Overrides EntityDisplayInterface:: | |
| EntityDisplayBase:: | protected | function | Handles a component type of 'hidden'. | |
| EntityDisplayBase:: | public | function | Gets the identifier. Overrides EntityBase:: | |
| EntityDisplayBase:: | protected | function | Initializes the display. | |
| EntityDisplayBase:: | public | function | Informs the entity that entities it depends on will be deleted. Overrides ConfigEntityBase:: | 1 | 
| EntityDisplayBase:: | public | function | Sets a component to be hidden. Overrides EntityDisplayInterface:: | |
| EntityDisplayBase:: | public | function | Sets the display options for a component. Overrides EntityDisplayInterface:: | 1 | 
| EntityDisplayBase:: | public | function | Sets the bundle to be displayed. Overrides EntityDisplayInterface:: | |
| EntityDisplayBase:: | public | function | Gets an array of all property values. Overrides ConfigEntityBase:: | |
| EntityDisplayBase:: | public | function | Overrides ConfigEntityBase:: | |
| EntityDisplayBase:: | public | function | Overrides DependencySerializationTrait:: | |
| EntityFormDisplay:: | protected | property | Context in which this entity will be used (e.g. 'view', 'form'). Overrides EntityDisplayBase:: | |
| EntityFormDisplay:: | public static | function | Returns the entity_form_display object used to build an entity form. | |
| EntityFormDisplay:: | public | function | Flags entity validation violations as form errors. Overrides EntityFormDisplayInterface:: | |
| EntityFormDisplay:: | public | function | Gets the plugin collections used by this object. Overrides ObjectWithPluginCollectionInterface:: | |
| EntityFormDisplay:: | public | function | Gets the renderer plugin for a field (e.g. widget, formatter). Overrides EntityDisplayInterface:: | |
| EntityFormDisplay:: | protected | function | Moves the property path to be relative to field level. | |
| EntityFormDisplay:: | public | function | Validates submitted widget values and sets the corresponding form errors. Overrides EntityFormDisplayInterface:: | |
| EntityFormDisplay:: | public | function | Constructs an Entity object. Overrides EntityDisplayBase:: | |
| FlexiformEntityFormDisplay:: | protected | property | The base entity namespace. | |
| FlexiformEntityFormDisplay:: | protected | property | Component types. | |
| FlexiformEntityFormDisplay:: | protected | property | The form enhancers. | |
| FlexiformEntityFormDisplay:: | protected | property | The form entity configuration. | |
| FlexiformEntityFormDisplay:: | protected | property | The flexiform form Entity Manager. | |
| FlexiformEntityFormDisplay:: | protected | property | What entities the form entity manager has been provided with. | |
| FlexiformEntityFormDisplay:: | protected | property | ||
| FlexiformEntityFormDisplay:: | public static | function | Look through the form to find submit buttons. | |
| FlexiformEntityFormDisplay:: | public | function | Build standalone form. | |
| FlexiformEntityFormDisplay:: | public | function | Adds field widgets to an entity form. Overrides EntityFormDisplay:: | |
| FlexiformEntityFormDisplay:: | public static | function | Collect the render display for a given entity_type_id and bundle. | |
| FlexiformEntityFormDisplay:: | protected | function | Decorate the form state when required. | |
| FlexiformEntityFormDisplay:: | public | function | Extracts field values from the submitted widget values into the entity. Overrides EntityFormDisplay:: | |
| FlexiformEntityFormDisplay:: | public | function | ||
| FlexiformEntityFormDisplay:: | public | function | ||
| FlexiformEntityFormDisplay:: | public | function | Get the base entity namespace. | |
| FlexiformEntityFormDisplay:: | public | function | Get the component plugin. | |
| FlexiformEntityFormDisplay:: | public | function | Get a compoenet type plugin. | |
| FlexiformEntityFormDisplay:: | public | function | Get a particular form enhancer. | |
| FlexiformEntityFormDisplay:: | public | function | Get the enhancers for this form display. | |
| FlexiformEntityFormDisplay:: | public | function | Get the Flexiform form Entity Configuration from the object. Overrides FlexiformEntityFormDisplayInterface:: | |
| FlexiformEntityFormDisplay:: | public | function | Get the form entity manager. | |
| FlexiformEntityFormDisplay:: | public | function | Get the entity form builder. | |
| FlexiformEntityFormDisplay:: | protected | function | Get the array of provided entities. | |
| FlexiformEntityFormDisplay:: | public | function | Returns an associative array of all regions. | |
| FlexiformEntityFormDisplay:: | public | function | Get the regions needed to create the overview form. | |
| FlexiformEntityFormDisplay:: | public | function | ||
| FlexiformEntityFormDisplay:: | public static | function | Acts on loaded entities. Overrides EntityBase:: | |
| FlexiformEntityFormDisplay:: | public | function | Acts on an entity before the presave hook is invoked. Overrides EntityDisplayBase:: | |
| FlexiformEntityFormDisplay:: | public | function | Process callback: assigns weights and hides extra fields. Overrides EntityFormDisplay:: | |
| FlexiformEntityFormDisplay:: | public | function | Save the extra entities added to the form. | |
| PluginDependencyTrait:: | protected | function | Calculates and adds dependencies of a specific plugin instance. | 1 | 
| PluginDependencyTrait:: | protected | function | Calculates and returns dependencies of a specific plugin instance. | |
| PluginDependencyTrait:: | protected | function | Wraps the module handler. | 1 | 
| PluginDependencyTrait:: | protected | function | Wraps the theme handler. | 1 | 
| RefinableCacheableDependencyTrait:: | public | function | 1 | |
| RefinableCacheableDependencyTrait:: | public | function | ||
| RefinableCacheableDependencyTrait:: | public | function | ||
| RefinableCacheableDependencyTrait:: | public | function | ||
| SynchronizableEntityTrait:: | protected | property | Whether this entity is being created, updated or deleted through a synchronization process. | |
| SynchronizableEntityTrait:: | public | function | ||
| SynchronizableEntityTrait:: | public | function | 
