class FileIsImageConstraint
Same name and namespace in other branches
- 10 core/modules/file/src/Plugin/Validation/Constraint/FileIsImageConstraint.php \Drupal\file\Plugin\Validation\Constraint\FileIsImageConstraint
- 11.x core/modules/file/src/Plugin/Validation/Constraint/FileIsImageConstraint.php \Drupal\file\Plugin\Validation\Constraint\FileIsImageConstraint
File is image constraint.
Attributes
#[Constraint(id: 'FileIsImage', label: new TranslatableMarkup('File Is Image', [], [
'context' => 'Validation',
]), type: 'file')]
Hierarchy
- class \Drupal\file\Plugin\Validation\Constraint\FileIsImageConstraint extends \Symfony\Component\Validator\Constraint
Expanded class hierarchy of FileIsImageConstraint
File
-
core/
modules/ file/ src/ Plugin/ Validation/ Constraint/ FileIsImageConstraint.php, line 15
Namespace
Drupal\file\Plugin\Validation\ConstraintView source
class FileIsImageConstraint extends SymfonyConstraint {
public function __construct(mixed $options = NULL, public string $message = 'The image file is invalid or the image type is not allowed. Allowed types: %types', ?array $groups = NULL, mixed $payload = NULL) {
parent::__construct($options, $groups, $payload);
}
}
Members
| Title Sort descending | Modifiers | Object type | Summary |
|---|---|---|---|
| FileIsImageConstraint::__construct | public | function | #[HasNamedArguments] |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.