Skip to content

Commit 2cef905

Browse files
committed
add Week and Yaml validators
1 parent d4c3ab4 commit 2cef905

File tree

1 file changed

+4
-0
lines changed
  • bundles/org.zikula.modulestudio.generator/src/org/zikula/modulestudio/generator/cartridges/symfony/models/business

1 file changed

+4
-0
lines changed

bundles/org.zikula.modulestudio.generator/src/org/zikula/modulestudio/generator/cartridges/symfony/models/business/ValidationConstraints.xtend

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ class ValidationConstraints {
171171
#[Assert\NoSuspiciousCharacters]
172172
«ELSEIF role == StringRole.UUID»
173173
#[Assert\Uuid(strict: true)]
174+
«ELSEIF role == StringRole.WEEK»
175+
#[Assert\Week]
174176
«ENDIF»
175177
'''
176178
private def lengthAnnotationString(AbstractStringField it, int length) '''
@@ -190,6 +192,8 @@ class ValidationConstraints {
190192
«lengthAnnotationString(length
191193
«IF role === TextRole.CODE_TWIG»
192194
#[Assert\Twig]
195+
«ELSEIF role === TextRole.CODE_YAML || role === TextRole.CODE_YAML_FM»
196+
#[Assert\Yaml]
193197
«ENDIF»
194198
'''
195199
def dispatch fieldAnnotations(UploadField it) '''

0 commit comments

Comments
 (0)