Skip to content

Commit 6688d8b

Browse files
authored
[Validator] UniqueEntity - add note about comparing files.
1 parent 45ad3bf commit 6688d8b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

reference/constraints/UniqueEntity.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,4 +402,10 @@ blank, ``findBy()`` will be used. The method receives as its argument a
402402
fields configured in the ``fields`` option). The method should return a
403403
:phpfunction:`countable PHP variable <is_countable>`.
404404

405+
.. note::
406+
407+
For ``binary`` and ``blob`` fields, instead of comparing large files directly,
408+
consider storing and comparing a hash (e.g., MD5) of the content in your
409+
custom ``repositoryMethod``.
410+
405411
.. _`race conditions`: https://en.wikipedia.org/wiki/Race_condition

0 commit comments

Comments
 (0)