function ExtensionAvailableConstraint::__construct

Attributes

#[HasNamedArguments]

File

core/lib/Drupal/Core/Extension/Plugin/Validation/Constraint/ExtensionAvailableConstraint.php, line 28

Class

ExtensionAvailableConstraint
Check if an extension (module, theme, or profile) is available.

Namespace

Drupal\Core\Extension\Plugin\Validation\Constraint

Code

public function __construct(mixed $options = NULL, ?string $type = NULL, public string $moduleNotExistsMessage = "Module '@name' is not available.", public string $themeNotExistsMessage = "Theme '@name' is not available.", public string $profileNotExistsMessage = "Profile '@name' is not available.", public string $couldNotLoadProfileToCheckExtension = "Profile '@profile' could not be loaded to check if the extension '@extension' is available.", ?array $groups = NULL, mixed $payload = NULL) {
  parent::__construct($options, $groups, $payload);
  $this->type = $type ?? $this->type;
}

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