php-symfony.model_variables.mustache Maven / Gradle / Ivy
/**
{{#description}}
* {{.}}
*
{{/description}}
* @var {{{vendorExtensions.x-comment-type}}}{{^required}}|null{{/required}}
* @SerializedName("{{baseName}}")
{{#required}}
* @Assert\NotNull()
{{^isPrimitiveType}}
* @Assert\Valid()
{{/isPrimitiveType}}
{{/required}}
{{#isEnum}}
{{#isContainer}}
* @Assert\All({
{{#items}}
* @Assert\Choice({ {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}} })
{{/items}}
* })
{{/isContainer}}
{{^isContainer}}
* @Assert\Choice({ {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}} })
{{/isContainer}}
{{/isEnum}}
{{#isContainer}}
* @Assert\All({
{{#items}}
* @Assert\Type("{{dataType}}")
{{/items}}
* })
{{#isMap}}
{{#items}}
* @Type("array")
{{/items}}
{{/isMap}}
{{^isMap}}
{{#items}}
* @Type("array<{{dataType}}>")
{{/items}}
{{/isMap}}
{{/isContainer}}
{{^isContainer}}
{{#isDate}}
* @Assert\Date()
* @Type("DateTime<'Y-m-d'>")
{{/isDate}}
{{#isDateTime}}
* @Assert\DateTime()
* @Type("DateTime")
{{/isDateTime}}
{{^isDate}}
{{^isDateTime}}
* @Assert\Type("{{dataType}}")
* @Type("{{dataType}}")
{{/isDateTime}}
{{/isDate}}
{{/isContainer}}
{{#hasValidation}}
{{#maxLength}}
* @Assert\Length(
* max = {{.}}
* )
{{/maxLength}}
{{#minLength}}
* @Assert\Length(
* min = {{.}}
* )
{{/minLength}}
{{#minimum}}
{{#exclusiveMinimum}}
* @Assert\GreaterThan({{minimum}})
{{/exclusiveMinimum}}
{{^exclusiveMinimum}}
* @Assert\GreaterThanOrEqual({{minimum}})
{{/exclusiveMinimum}}
{{/minimum}}
{{#maximum}}
{{#exclusiveMaximum}}
* @Assert\LessThan({{minimum}})
{{/exclusiveMaximum}}
{{^exclusiveMaximum}}
* @Assert\LessThanOrEqual({{minimum}})
{{/exclusiveMaximum}}
{{/maximum}}
{{#pattern}}
* @Assert\Regex("/{{.}}/")
{{/pattern}}
{{#maxItems}}
* @Assert\Count(
* max = {{.}}
* )
{{/maxItems}}
{{#minItems}}
* @Assert\Count(
* min = {{.}}
* )
{{/minItems}}
{{/hasValidation}}
*/
protected ${{name}};