Skip to content

Commit eafe755

Browse files
committed
Merge branch '7.3' into 7.4
* 7.3: Minor tweak [Validator] UniqueEntity - add note about comparing files.
2 parents fe02c37 + de555d7 commit eafe755

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
@@ -397,4 +397,10 @@ blank, ``findBy()`` will be used. The method receives as its argument a
397397
fields configured in the ``fields`` option). The method should return a
398398
:phpfunction:`countable PHP variable <is_countable>`.
399399

400+
.. tip::
401+
402+
For ``binary`` and ``blob`` fields, instead of comparing large files directly,
403+
consider storing and comparing a hash (e.g. ``hash('xxh128', $contents)``)
404+
of the contents in your custom ``repositoryMethod``.
405+
400406
.. _`race conditions`: https://en.wikipedia.org/wiki/Race_condition

0 commit comments

Comments
 (0)