ActionStorageController.php

Contains \Drupal\system\ActionStorageController.

Namespace

Drupal\system

File

drupal/core/modules/system/lib/Drupal/system/ActionStorageController.php
View source
<?php

/**
 * @file
 * Contains \Drupal\system\ActionStorageController.
 */
namespace Drupal\system;

use Drupal\Core\Action\ConfigurableActionInterface;
use Drupal\Core\Config\Entity\ConfigStorageController;
use Drupal\Core\Entity\EntityInterface;

/**
 * Defines the storage controller class for Action entities.
 */
class ActionStorageController extends ConfigStorageController {

  /**
   * {@inheritdoc}
   */
  protected function preSave(EntityInterface $entity) {
    parent::preSave($entity);
    $plugin = $entity
      ->getPlugin();

    // If this plugin has any configuration, ensure that it is set.
    if ($plugin instanceof ConfigurableActionInterface) {
      $entity
        ->set('configuration', $plugin
        ->getConfiguration());
    }
  }

}

Classes

Namesort descending Description
ActionStorageController Defines the storage controller class for Action entities.