class StorageEntityApi in Configuration Management 7.2
Hierarchy
- class \Drupal\configuration\Storage\Storage
- class \Drupal\configuration\Storage\StoragePhp
- class \Drupal\configuration\Storage\StorageEntityApi
- class \Drupal\configuration\Storage\StoragePhp
Expanded class hierarchy of StorageEntityApi
File
- lib/
Drupal/ configuration/ Storage/ StorageEntityApi.php, line 12 - Definition of Drupal\configuration\Storage\StorageEntityApi.
Namespace
Drupal\configuration\StorageView source
class StorageEntityApi extends StoragePHP {
// The class that storages the data of the configuration
protected $entity_type;
public function __construct($entity_type) {
parent::__construct();
$this->entity_type = $entity_type;
}
/**
* Saves the configuration object into the DataStore.
*/
public function getDataToSave() {
$filename = $this->filename;
$export = '$api = ' . $this
->export($this->api_version) . ";\n\n";
$export .= '$data = entity_import(\'' . $this->entity_type . "', '" . addcslashes(entity_export($this->entity_type, $this->data, ' '), '\\\'') . "');\n\n";
$export .= '$dependencies = ' . $this
->export($this->dependencies) . ";\n\n";
$export .= '$optional = ' . $this
->export($this->optional_configurations) . ";\n\n";
$export .= '$modules = ' . $this
->export($this->required_modules) . ";";
$file_contents = "<?php\n/**\n * @file\n * {$filename}\n */\n\n" . $export . "\n";
$this->hash = sha1($file_contents);
return $file_contents;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Storage:: |
protected | property | ||
Storage:: |
protected | property | ||
Storage:: |
protected | property | ||
Storage:: |
protected | property | ||
Storage:: |
protected | property | ||
Storage:: |
protected | property | ||
Storage:: |
protected | property | ||
Storage:: |
protected | property | ||
Storage:: |
protected | property | ||
Storage:: |
public static | function | Returns TRUE if the path is a directory or we can create one in that path. | |
Storage:: |
public static | function | Returns TRUE if the current user has write permissions for a configuration file in the config:// directory. | |
Storage:: |
public | function | ||
Storage:: |
public static | function | Returns TRUE if the file for a configuration exists in the config:// directory. | |
Storage:: |
public | function | ||
Storage:: |
public | function | ||
Storage:: |
public | function | ||
Storage:: |
public static | function | ||
Storage:: |
public | function | ||
Storage:: |
public | function | ||
Storage:: |
public | function | ||
Storage:: |
public | function | ||
Storage:: |
public | function | ||
Storage:: |
public | function | ||
Storage:: |
public | function | ||
Storage:: |
public | function | ||
Storage:: |
public | function | ||
Storage:: |
public | function | ||
Storage:: |
public | function | Set an array of keys names to export. If the array is empty, all the keys of the configuration will be exported. | |
Storage:: |
public | function | ||
Storage:: |
public | function | ||
Storage:: |
public | function | ||
StorageEntityApi:: |
protected | property | ||
StorageEntityApi:: |
public | function |
Saves the configuration object into the DataStore. Overrides StoragePhp:: |
|
StorageEntityApi:: |
public | function |
Overrides Storage:: |
|
StoragePhp:: |
public static | property |
Overrides Storage:: |
|
StoragePhp:: |
public | function | ||
StoragePhp:: |
public | function |
Adapted from CTools ctools_var_export(). Overrides Storage:: |
|
StoragePhp:: |
public | function |
Overrides Storage:: |
|
StoragePhp:: |
public | function |
Loads the configuration object from the DataStore. Overrides Storage:: |
|
StoragePhp:: |
public | function |
Saves the configuration object into the DataStore. Overrides Storage:: |