Skip to content
Snippets Groups Projects

Add constraints to image.settings and mark it fully validatable

Files
8
@@ -12,6 +12,7 @@
@@ -12,6 +12,7 @@
use Symfony\Component\Validator\Constraints\Blank;
use Symfony\Component\Validator\Constraints\Blank;
use Symfony\Component\Validator\Constraints\Callback;
use Symfony\Component\Validator\Constraints\Callback;
use Symfony\Component\Validator\Constraints\Choice;
use Symfony\Component\Validator\Constraints\Choice;
 
use Symfony\Component\Validator\Constraints\Image;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\NotBlank;
/**
/**
@@ -116,6 +117,11 @@ public function registerDefinitions() {
@@ -116,6 +117,11 @@ public function registerDefinitions() {
'class' => Choice::class,
'class' => Choice::class,
'type' => FALSE,
'type' => FALSE,
]);
]);
 
$this->getDiscovery()->setDefinition('Image', [
 
'label' => new TranslatableMarkup('Image'),
 
'class' => Image::class,
 
'type' => ['string'],
 
]);
}
}
/**
/**
Loading