class ConfigSchemaDiscovery

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Config/Schema/ConfigSchemaDiscovery.php \Drupal\Core\Config\Schema\ConfigSchemaDiscovery
  2. 10 core/lib/Drupal/Core/Config/Schema/ConfigSchemaDiscovery.php \Drupal\Core\Config\Schema\ConfigSchemaDiscovery
  3. 11.x 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

Title Sort descending Modifiers Object type Summary Overriden Title 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

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