From 1881480ea5613822b632709b8a4db7c63fce9964 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Wed, 13 Sep 2023 14:30:52 +0200 Subject: [PATCH] [Validator] Add `is_valid()` expression --- reference/constraints/Expression.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/reference/constraints/Expression.rst b/reference/constraints/Expression.rst index 593aa4b8ba7..877b45c4004 100644 --- a/reference/constraints/Expression.rst +++ b/reference/constraints/Expression.rst @@ -244,6 +244,14 @@ in your expression: * ``value``: The value of the property being validated (only available when the constraint is applied directly to a property); +You also have access to the ``is_valid()`` function in your expression. It +allows to check that the data passed to function doesn't raise any +validation violation. + +.. versionadded:: 6.4 + + The ``is_valid()`` expression function was introduced in Symfony 6.4. + .. include:: /reference/constraints/_groups-option.rst.inc ``message``