@@ -244,18 +244,10 @@ $beforeInsert
244
244
^^^^^^^^^^^^^
245
245
$afterInsert
246
246
^^^^^^^^^^^^
247
- $beforeInsertBatch
248
- ^^^^^^^^^^^^^^^^^^
249
- $afterInsertBatch
250
- ^^^^^^^^^^^^^^^^^
251
247
$beforeUpdate
252
248
^^^^^^^^^^^^^
253
249
$afterUpdate
254
250
^^^^^^^^^^^^^
255
- $beforeUpdateBatch
256
- ^^^^^^^^^^^^^^^^^^
257
- $afterUpdateBatch
258
- ^^^^^^^^^^^^^^^^^
259
251
$beforeFind
260
252
^^^^^^^^^^^
261
253
$afterFind
@@ -264,6 +256,14 @@ $beforeDelete
264
256
^^^^^^^^^^^^^
265
257
$afterDelete
266
258
^^^^^^^^^^^^
259
+ $beforeInsertBatch
260
+ ^^^^^^^^^^^^^^^^^^
261
+ $afterInsertBatch
262
+ ^^^^^^^^^^^^^^^^^
263
+ $beforeUpdateBatch
264
+ ^^^^^^^^^^^^^^^^^^
265
+ $afterUpdateBatch
266
+ ^^^^^^^^^^^^^^^^^
267
267
268
268
These arrays allow you to specify callback methods that will be run on the data at the
269
269
time specified in the property name.
@@ -718,10 +718,17 @@ Model Events
718
718
************
719
719
720
720
There are several points within the model's execution that you can specify multiple callback methods to run.
721
- These methods can be used to normalize data, hash passwords, save related entities, and much more. The following
722
- points in the model's execution can be affected, each through a class property: ``$beforeInsert ``, ``$afterInsert ``,
723
- ``$beforeInsertBatch ``, ``$afterInsertBatch ``, ``$beforeUpdate ``, ``$afterUpdate ``, ``$beforeUpdateBatch ``,
724
- ``$afterUpdateBatch ``, ``$afterFind ``, and ``$afterDelete ``.
721
+ These methods can be used to normalize data, hash passwords, save related entities, and much more.
722
+
723
+ The following
724
+ points in the model's execution can be affected, each through a class property:
725
+
726
+ - `$beforeInsert `_, `$afterInsert `_
727
+ - `$beforeUpdate `_, `$afterUpdate `_
728
+ - `$beforeFind `_, `$afterFind `_
729
+ - `$beforeDelete `_, `$afterDelete `_
730
+ - `$beforeInsertBatch `_, `$afterInsertBatch `_
731
+ - `$beforeUpdateBatch `_, `$afterUpdateBatch `_
725
732
726
733
.. note :: ``$beforeInsertBatch``, ``$afterInsertBatch``, ``$beforeUpdateBatch`` and
727
734
``$afterUpdateBatch `` can be used since v4.3.0.
@@ -769,20 +776,12 @@ beforeInsert **data** = the key/value pairs that are being inserted. If an
769
776
afterInsert **id ** = the primary key of the new row, or 0 on failure.
770
777
**data ** = the key/value pairs being inserted.
771
778
**result ** = the results of the insert() method used through the Query Builder.
772
- beforeInsertBatch **data ** = associative array of values that are being inserted. If an object or Entity class is passed to the
773
- insertBatch method, it is first converted to an array.
774
- afterInsertBatch **data ** = the associative array of values being inserted.
775
- **result ** = the results of the insertbatch() method used through the Query Builder.
776
779
beforeUpdate **id ** = the array of primary keys of the rows being updated.
777
780
**data ** = the key/value pairs that are being updated. If an object or Entity class is passed to the
778
781
update method, it is first converted to an array.
779
782
afterUpdate **id ** = the array of primary keys of the rows being updated.
780
783
**data ** = the key/value pairs being updated.
781
784
**result ** = the results of the update() method used through the Query Builder.
782
- beforeUpdateBatch **data ** = associative array of values that are being updated. If an object or Entity class is passed to the
783
- updateBatch method, it is first converted to an array.
784
- afterUpdateBatch **data ** = the key/value pairs being updated.
785
- **result ** = the results of the updateBatch() method used through the Query Builder.
786
785
beforeFind The name of the calling **method **, whether a **singleton ** was requested, and these additional fields:
787
786
- first() No additional fields
788
787
- find() **id ** = the primary key of the row being searched for.
@@ -796,6 +795,14 @@ afterDelete **id** = primary key of row being deleted.
796
795
**purge ** = boolean whether soft-delete rows should be hard deleted.
797
796
**result ** = the result of the delete() call on the Query Builder.
798
797
**data ** = unused.
798
+ beforeInsertBatch **data ** = associative array of values that are being inserted. If an object or Entity class is passed to the
799
+ insertBatch method, it is first converted to an array.
800
+ afterInsertBatch **data ** = the associative array of values being inserted.
801
+ **result ** = the results of the insertbatch() method used through the Query Builder.
802
+ beforeUpdateBatch **data ** = associative array of values that are being updated. If an object or Entity class is passed to the
803
+ updateBatch method, it is first converted to an array.
804
+ afterUpdateBatch **data ** = the key/value pairs being updated.
805
+ **result ** = the results of the updateBatch() method used through the Query Builder.
799
806
================= =========================================================================================================
800
807
801
808
Modifying Find* Data
0 commit comments