protected function BlockStorageController::preSave

Acts on an entity before the presave hook is invoked.

Used before the entity is saved and before invoking the presave hook.

Overrides ConfigStorageController::preSave

File

drupal/core/modules/block/lib/Drupal/block/BlockStorageController.php, line 32
Contains \Drupal\block\BlockStorageController.

Class

BlockStorageController
Defines the storage controller class for Block entities.

Namespace

Drupal\block

Code

protected function preSave(EntityInterface $entity) {
  parent::preSave($entity);
  $entity
    ->set('settings', $entity
    ->getPlugin()
    ->getConfig());
}