class RequiredConfigDependenciesConstraint

Same name in other branches
  1. 11.x core/lib/Drupal/Core/Config/Plugin/Validation/Constraint/RequiredConfigDependenciesConstraint.php \Drupal\Core\Config\Plugin\Validation\Constraint\RequiredConfigDependenciesConstraint

Checks that config dependencies contain specific types of entities.

Hierarchy

Expanded class hierarchy of RequiredConfigDependenciesConstraint

File

core/lib/Drupal/Core/Config/Plugin/Validation/Constraint/RequiredConfigDependenciesConstraint.php, line 14

Namespace

Drupal\Core\Config\Plugin\Validation\Constraint
View source
class RequiredConfigDependenciesConstraint extends SymfonyConstraint {
    
    /**
     * The error message.
     *
     * @var string
     */
    public string $message = 'This @entity_type requires a @dependency_type.';
    
    /**
     * The IDs of entity types that need to exist in config dependencies.
     *
     * For example, if an entity requires a filter format in its config
     * dependencies, this should contain `filter_format`.
     *
     * @var string[]
     */
    public array $entityTypes = [];
    
    /**
     * {@inheritdoc}
     */
    public function getRequiredOptions() {
        return [
            'entityTypes',
        ];
    }
    
    /**
     * {@inheritdoc}
     */
    public function getDefaultOption() {
        return 'entityTypes';
    }

}

Members

Title Sort descending Modifiers Object type Summary
RequiredConfigDependenciesConstraint::$entityTypes public property The IDs of entity types that need to exist in config dependencies.
RequiredConfigDependenciesConstraint::$message public property The error message.
RequiredConfigDependenciesConstraint::getDefaultOption public function
RequiredConfigDependenciesConstraint::getRequiredOptions public function

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