From 6688d8b9898906623e4b2eb646c1c3d2288af2fe Mon Sep 17 00:00:00 2001 From: wkania Date: Fri, 1 Aug 2025 18:27:55 +0200 Subject: [PATCH] [Validator] UniqueEntity - add note about comparing files. --- reference/constraints/UniqueEntity.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/constraints/UniqueEntity.rst b/reference/constraints/UniqueEntity.rst index 0e1731371a5..5bde224e79d 100644 --- a/reference/constraints/UniqueEntity.rst +++ b/reference/constraints/UniqueEntity.rst @@ -402,4 +402,10 @@ blank, ``findBy()`` will be used. The method receives as its argument a fields configured in the ``fields`` option). The method should return a :phpfunction:`countable PHP variable `. +.. note:: + + For ``binary`` and ``blob`` fields, instead of comparing large files directly, + consider storing and comparing a hash (e.g., MD5) of the content in your + custom ``repositoryMethod``. + .. _`race conditions`: https://en.wikipedia.org/wiki/Race_condition