You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add optional dbGroup support in validation rules for multiple database connections
cs fixer
docs format
fix rules
add test testIsNotUniqueWithDBConnectionAsParameter
docs: update v4.5.6.rst
docs: fix tabs
docs update for v4.6.0
Update validation.rst
Update user_guide_src/source/changelogs/v4.6.0.rst
Co-authored-by: Michal Sniatala <michal@sniatala.pl>
Add a test case for `InvalidArgumentException` and remove the duplicate comment.
refactor: code for is_unique and is_not_unique methods; extracted common code into prepareUniqueQuery method
rector and phpstan fix
Copy file name to clipboardExpand all lines: user_guide_src/source/libraries/validation.rst
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -949,13 +949,16 @@ is_natural No Fails if field contains anything other than
949
949
is_natural_no_zero No Fails if field contains anything other than
950
950
a natural number, except zero: ``1``, ``2``,
951
951
``3``, etc.
952
-
is_not_unique Yes Checks the database to see if the given value ``is_not_unique[table.field,where_field,where_value]``
952
+
is_not_unique Yes Checks the database to see if the given value ``is_not_unique[table.field,where_field,where_value]`` or ``is_not_unique[dbGroup.table.field,where_field,where_value]``
953
953
exists. Can ignore records by field/value to
954
954
filter (currently accept only one filter).
955
-
is_unique Yes Checks if this field value exists in the ``is_unique[table.field,ignore_field,ignore_value]``
955
+
(Since v4.6.0, you can optionally pass
956
+
the dbGroup as a parameter)
957
+
is_unique Yes Checks if this field value exists in the ``is_unique[table.field,ignore_field,ignore_value]`` or ``is_unique[dbGroup.table.field,ignore_field,ignore_value]``
956
958
database. Optionally set a column and value
957
959
to ignore, useful when updating records to
958
-
ignore itself.
960
+
ignore itself. (Since v4.6.0, you can
961
+
optionally pass the dbGroup as a parameter)
959
962
less_than Yes Fails if field is greater than or equal to ``less_than[8]``
960
963
the parameter value or not numeric.
961
964
less_than_equal_to Yes Fails if field is greater than the parameter ``less_than_equal_to[8]``
@@ -1094,7 +1097,7 @@ min_dims Yes Fails if the minimum width and height of an
1094
1097
parameter is the field name. The second is
1095
1098
the width, and the third is the height. Will
1096
1099
also fail if the file cannot be determined
1097
-
to be an image. (This rule was added in
1100
+
to be an image. (This rule was added in
1098
1101
v4.6.0.)
1099
1102
mime_in Yes Fails if the file's mime type is not one ``mime_in[field_name,image/png,image/jpeg]``
0 commit comments