namespaces:
    doctrine: Symfony\Bridge\Doctrine\Validator\Constraints\
    oro_entity_extend: Oro\Bundle\EntityExtendBundle\Validator\Constraints\

Oro\Bundle\EntityConfigBundle\Entity\FieldConfigModel:
    group_sequence: [FieldConfigModel, Sql, UniqueField, UniqueMethod]
    constraints:
        - oro_entity_extend:UniqueExtendEntityField: {groups: UniqueField}
        - oro_entity_extend:ChangeTypeExtendEntityField: {groups: ChangeTypeField}
        - oro_entity_extend:DefaultRelationField: {groups: [UniqueField, ChangeTypeField]}
        - oro_entity_extend:MultiEnumSnapshotField: {groups: [UniqueField, ChangeTypeField]}
        - oro_entity_extend:UniqueExtendEntityMethodName: {groups: UniqueMethod}
        - oro_entity_extend:AttributeField: {groups: AttributeField}
        - oro_entity_extend:AttributeConfiguration: {groups: AttributeField}
    properties:
        fieldName:
            - NotBlank: ~
            - oro_entity_extend:FieldNameLength: ~
            - Regex:
                pattern: "/^[a-z]+[a-z0-9_]*$/i"
                message: "This value should start with a symbol and contain only alphabetic symbols, underscore and numbers."
            - Regex:
                pattern: "/^id$/i"
                match:   false
                message: "The '{{ value }}' cannot be used as a field name."
            - oro_entity_extend:NotSqlKeyword: {groups: Sql}
        type:
            - NotBlank: ~

Oro\Bundle\EntityConfigBundle\Entity\EntityConfigModel:
    group_sequence: [EntityConfigModel, Sql, Php]
    constraints:
        - doctrine:UniqueEntity: [className]
    properties:
        className:
            - NotBlank:  ~
            - Regex:
                pattern: "/^([0-9]+[a-zA-Z]+|[a-zA-Z]+)[0-9a-zA-Z]*$/i"
                message: "This value should contain only alphabetic symbols and numbers."
            - oro_entity_extend:NotSqlKeyword: {groups: Sql}
            - oro_entity_extend:NotPhpKeyword: {groups: Php}

Oro\Bundle\EntityExtendBundle\Model\EnumValue:
    constraints:
        - oro_entity_extend:EnumValue: ~
    properties:
        label:
            - NotBlank: ~
            - Length:
                max: 255
