Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. FieldLayoutEntityDisplayTrait.php

function FieldLayoutEntityDisplayTrait::preSave

Overrides \Drupal\Core\Entity\EntityDisplayBase::preSave().

File

core/modules/field_layout/src/Entity/FieldLayoutEntityDisplayTrait.php, line 113

Class

FieldLayoutEntityDisplayTrait
Provides shared code for entity displays.

Namespace

Drupal\field_layout\Entity

Code

public function preSave(EntityStorageInterface $storage) {
    parent::preSave($storage);
    // Ensure the plugin configuration is updated. Once layouts are no longer
    // stored as third party settings, this will be handled by the code in
    // \Drupal\Core\Config\Entity\ConfigEntityBase::preSave() that handles
    // \Drupal\Core\Entity\EntityWithPluginCollectionInterface.
    if ($this->getLayoutId()) {
        $this->setLayout($this->getLayout());
    }
}
RSS feed
Powered by Drupal