Skip to content

Commit 56a93c4

Browse files
authored
Merge pull request #8115 from cakephp/5.next-nullable-null
5.next: Add ExistsInNullable
2 parents 3e4eb2a + 1fbf702 commit 56a93c4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

en/appendices/5-3-migration-guide.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ Validation
217217
- ``ipOrRange()`` validation has has been added to check for an IP or a range (subnet).
218218
- When validating within CakePHP marshalling context, the entity will be passed into the ``context`` argument for use inside custom validation rules.
219219
This can be useful when patching partially and then needing to get that data from the entity instead of the passed data.
220+
- ``existsInNullable()`` rule has been added. This rule allows ``null`` values in nullable composite foreign keys,
221+
which is semantically correct for optional relationships. Use ``$rules->existsInNullable(['author_id', 'site_id'], 'SiteAuthors')``
222+
instead of ``existsIn()`` when you want to permit null values in foreign keys.
220223

221224
View
222225
----

0 commit comments

Comments
 (0)