From caf3e1f99e85bc9af42e51f13071a923b8d031e4 Mon Sep 17 00:00:00 2001 From: Wojciech Kania Date: Wed, 13 Apr 2022 23:05:16 +0200 Subject: [PATCH] [Validator] Add the fields option to the Unique constraint --- reference/constraints/Unique.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/reference/constraints/Unique.rst b/reference/constraints/Unique.rst index 7a3e36c5aba..ad6e148254d 100644 --- a/reference/constraints/Unique.rst +++ b/reference/constraints/Unique.rst @@ -103,6 +103,20 @@ strings: Options ------- +``fields`` +~~~~~~~~~~ + +**type**: ``array`` | ``string`` + + +.. versionadded:: 6.1 + + The ``fields`` option was introduced in Symfony 6.1. + +This is optional and defines key or keys +in a collection that should be checked for uniqueness. +By default, all collection keys are checked for uniqueness. + .. include:: /reference/constraints/_groups-option.rst.inc ``message``