ImportableEntityStorageInterface.php

Same filename in other branches
  1. 9 core/lib/Drupal/Core/Config/Entity/ImportableEntityStorageInterface.php
  2. 10 core/lib/Drupal/Core/Config/Entity/ImportableEntityStorageInterface.php
  3. 11.x core/lib/Drupal/Core/Config/Entity/ImportableEntityStorageInterface.php

Namespace

Drupal\Core\Config\Entity

File

core/lib/Drupal/Core/Config/Entity/ImportableEntityStorageInterface.php

View source
<?php

namespace Drupal\Core\Config\Entity;

use Drupal\Core\Config\Config;

/**
 * Provides an interface for responding to configuration imports.
 *
 * When configuration is synchronized between storages, the entity storage must
 * handle the synchronization of configuration data for its entity.
 */
interface ImportableEntityStorageInterface {
    
    /**
     * Creates entities upon synchronizing configuration changes.
     *
     * @param string $name
     *   The name of the configuration object.
     * @param \Drupal\Core\Config\Config $new_config
     *   A configuration object containing the new configuration data.
     * @param \Drupal\Core\Config\Config $old_config
     *   A configuration object containing the old configuration data.
     */
    public function importCreate($name, Config $new_config, Config $old_config);
    
    /**
     * Updates entities upon synchronizing configuration changes.
     *
     * @param string $name
     *   The name of the configuration object.
     * @param \Drupal\Core\Config\Config $new_config
     *   A configuration object containing the new configuration data.
     * @param \Drupal\Core\Config\Config $old_config
     *   A configuration object containing the old configuration data.
     *
     * @throws \Drupal\Core\Config\ConfigImporterException
     *   Thrown when the config entity that should be updated can not be found.
     */
    public function importUpdate($name, Config $new_config, Config $old_config);
    
    /**
     * Delete entities upon synchronizing configuration changes.
     *
     * @param string $name
     *   The name of the configuration object.
     * @param \Drupal\Core\Config\Config $new_config
     *   A configuration object containing the new configuration data.
     * @param \Drupal\Core\Config\Config $old_config
     *   A configuration object containing the old configuration data.
     */
    public function importDelete($name, Config $new_config, Config $old_config);
    
    /**
     * Renames entities upon synchronizing configuration changes.
     *
     * @param string $old_name
     *   The original name of the configuration object.
     * @param \Drupal\Core\Config\Config $new_config
     *   A configuration object containing the new configuration data.
     * @param \Drupal\Core\Config\Config $old_config
     *   A configuration object containing the old configuration data.
     */
    public function importRename($old_name, Config $new_config, Config $old_config);

}

Interfaces

Title Deprecated Summary
ImportableEntityStorageInterface Provides an interface for responding to configuration imports.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.