2024-05-06 20:40:05 +00:00
|
|
|
---
|
2024-10-30 17:34:11 +00:00
|
|
|
date: 2020-11-16
|
2024-05-06 20:40:05 +00:00
|
|
|
id: 3a90ffd1-7d51-4ade-ad6e-8924c15d956d
|
|
|
|
title: ExpressionLanguageSyntax Constraint
|
|
|
|
---
|
|
|
|
|
|
|
|
# Description
|
|
|
|
|
|
|
|
Checks that passed [expression
|
|
|
|
language](20201109150640-expressionlanguage_constraint) is valid.
|
|
|
|
|
|
|
|
# Syntax
|
|
|
|
|
|
|
|
``` php
|
|
|
|
namespace App\Entity;
|
|
|
|
|
|
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
|
|
|
|
|
|
|
class Order
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @Assert\ExpressionLanguageSyntax()
|
|
|
|
*/
|
|
|
|
protected $promotion;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Assert\ExpressionLanguageSyntax(
|
|
|
|
* names = ['user', 'shipping_centers'],
|
|
|
|
* validateNames = true
|
|
|
|
* )
|
|
|
|
*/
|
|
|
|
protected $shippingOptions;
|
|
|
|
}
|
|
|
|
```
|