You are here

class ConfigSchemaDiscovery in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Config/Schema/ConfigSchemaDiscovery.php \Drupal\Core\Config\Schema\ConfigSchemaDiscovery

Allows YAML files to define config schema types.

Hierarchy

Expanded class hierarchy of ConfigSchemaDiscovery

1 file declares its use of ConfigSchemaDiscovery
TypedConfigManager.php in core/lib/Drupal/Core/Config/TypedConfigManager.php

File

core/lib/Drupal/Core/Config/Schema/ConfigSchemaDiscovery.php, line 12

Namespace

Drupal\Core\Config\Schema
View source
class ConfigSchemaDiscovery implements DiscoveryInterface {
  use DiscoveryTrait;

  /**
   * A storage instance for reading configuration schema data.
   *
   * @var \Drupal\Core\Config\StorageInterface
   */
  protected $schemaStorage;

  /**
   * Constructs a ConfigSchemaDiscovery object.
   *
   * @param $schema_storage
   *   The storage object to use for reading schema data.
   */
  public function __construct(StorageInterface $schema_storage) {
    $this->schemaStorage = $schema_storage;
  }

  /**
   * {@inheritdoc}
   */
  public function getDefinitions() {
    $definitions = [];
    foreach ($this->schemaStorage
      ->readMultiple($this->schemaStorage
      ->listAll()) as $schema) {
      foreach ($schema as $type => $definition) {
        $definitions[$type] = $definition;
      }
    }
    return $definitions;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigSchemaDiscovery::$schemaStorage protected property A storage instance for reading configuration schema data.
ConfigSchemaDiscovery::getDefinitions public function Gets the definition of all plugins for this type. Overrides DiscoveryTrait::getDefinitions
ConfigSchemaDiscovery::__construct public function Constructs a ConfigSchemaDiscovery object.
DiscoveryTrait::doGetDefinition protected function Gets a specific plugin definition.
DiscoveryTrait::getDefinition public function 3
DiscoveryTrait::hasDefinition public function