BitBag\SyliusCmsPlugin\Entity\Block:
    constraints:
        - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity:
            fields: [code]
            groups: ['bitbag']
            message: 'bitbag_sylius_cms_plugin.block.code.unique'
    properties:
        code:
            - NotBlank:
                message: 'bitbag_sylius_cms_plugin.block.code.not_blank'
                groups: ['bitbag']
            - Length:
                min: 2
                max: 250
                minMessage: 'bitbag_sylius_cms_plugin.block.code.min_length'
                maxMessage: 'bitbag_sylius_cms_plugin.block.code.max_length'
                groups: ['bitbag']
            - Regex:
                  pattern: '/^[\w-]*$/'
                  message: 'bitbag_sylius_cms_plugin.block.code.regex'
                  groups: [ 'bitbag' ]
        translations:
            - Valid: ~
