File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88 <import resource =" services/etc.xml" />
99 <import resource =" services/form.xml" />
1010 <import resource =" services/messenger.xml" />
11+ <import resource =" services/validator.xml" />
1112 </imports >
1213</container >
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+
3+ <container xmlns =" http://symfony.com/schema/dic/services"
4+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
5+ xsi : schemaLocation =" http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd" >
6+ <services >
7+
8+ <service id =" loevgaard_sylius_barcode.validator.barcode"
9+ class =" Loevgaard\SyliusBarcodePlugin\Validator\BarcodeValidator" >
10+ <tag name =" validator.constraint_validator"
11+ alias =" loevgaard_sylius_barcode.validator.valid_barcode" />
12+ </service >
13+
14+ </services >
15+ </container >
Original file line number Diff line number Diff line change @@ -13,4 +13,9 @@ class Barcode extends Constraint
1313{
1414 /** @var string */
1515 public $ message = 'The string "{{ string }}" is not a valid barcode. ' ;
16+
17+ public function validatedBy (): string
18+ {
19+ return 'loevgaard_sylius_barcode.validator.valid_barcode ' ;
20+ }
1621}
You can’t perform that action at this time.
0 commit comments