Skip to content

Commit 3064215

Browse files
authored
Merge pull request #7832 from cakephp/rules-remove
Add docs for cakephp/cakephp#17634
2 parents 15ede3d + 408a9c8 commit 3064215

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ Core
6464
a typesafe way to cast request data or other input and return ``null`` when conversion fails.
6565
- ``pathCombine()`` was added to help build paths without worrying about duplicate and trailing slashes.
6666

67+
Datasource
68+
----------
69+
70+
- ``RulesChecker::remove()``, ``removeCreate()``, ``removeUpdate()``, and
71+
``removeDelete()`` methods were added. These methods allow you to remove rules
72+
by name.
73+
6774
Http
6875
----
6976

en/orm/validation.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,3 +742,22 @@ The same result can be expected when using ``newEntity()`` or
742742

743743
$userEntity = $usersTable->newEntity(['email' => 'not an email!!']);
744744
$userEntity->getError('email'); // Invalid email
745+
746+
Removing Rules
747+
--------------
748+
749+
If you need to remove rules from a ``RulesChecker`` use a remove method::
750+
751+
// Remove a general rule by name
752+
$rules->remove('ruleName');
753+
754+
// Remove a create rule
755+
$rules->removeCreate('ruleName');
756+
757+
// Remove an update rule
758+
$rules->removeUpdate('ruleName');
759+
760+
// Remove a delete rule
761+
$rules->removeDelete('ruleName');
762+
763+
.. versionadded:: 5.1.0

0 commit comments

Comments
 (0)