public function Config::get in Schema 8
Parameters
bool $rebuild: Whether to force a rebuild of schema data.
Return value
array Array of schema information, keyed by table.
Overrides SchemaProviderInterface::get
File
- src/
Plugin/ Schema/ Config.php, line 26 - Contains Drupal\schema\Plugin\Schema\Config.
Class
- Config
- Provides schema information for config storage tables.
Namespace
Drupal\schema\Plugin\SchemaCode
public function get($rebuild = FALSE) {
$complete_schema = array();
foreach (array(
'config.storage.staging',
'config.storage.snapshot',
'config.storage',
) as $service_id) {
$backend = \Drupal::service($service_id);
// The config.storage.active service is not accessible directly, therefore
// retrieve the actual active backend from the config.storage service.
if ($backend instanceof CachedStorage) {
$reflection = new ReflectionClass(get_class($backend));
$property = $reflection
->getProperty('storage');
$property
->setAccessible(TRUE);
$backend = $property
->getValue($backend);
}
if ($backend instanceof DatabaseStorage) {
$reflection = new ReflectionClass(get_class($backend));
$schema_method = $reflection
->getMethod('schemaDefinition');
$schema_method
->setAccessible(TRUE);
$name_property = $reflection
->getProperty('table');
$name_property
->setAccessible(TRUE);
$table_name = $name_property
->getValue($backend);
$schema = $schema_method
->invoke($backend);
$complete_schema[$table_name] = $schema + array(
'module' => 'Core\\Config',
);
}
}
return $complete_schema;
}