@@ -579,7 +579,8 @@ Model Events
579579There are several points within the model's execution that you can specify multiple callback methods to run.
580580These methods can be used to normalize data, hash passwords, save related entities, and much more. The following
581581points in the model's execution can be affected, each through a class property: ``$beforeInsert ``, ``$afterInsert ``,
582- ``$beforeUpdate ``, ``$afterUpdate ``, ``$afterFind ``, and ``$afterDelete ``.
582+ ``$beforeInsertBatch ``, ``$afterInsertBatch ``, ``$beforeUpdate ``, ``$afterUpdate ``, ``$beforeUpdateBatch ``,
583+ ``$afterUpdateBatch ``, ``$afterFind ``, and ``$afterDelete ``.
583584
584585Defining Callbacks
585586==================
@@ -616,20 +617,28 @@ Event Parameters
616617Since the exact data passed to each callback varies a bit, here are the details on what is in the ``$data `` parameter
617618passed to each event:
618619
619- ================ =========================================================================================================
620- Event $data contents
621- ================ =========================================================================================================
620+ ================= =========================================================================================================
621+ Event $data contents
622+ ================= =========================================================================================================
622623beforeInsert **data ** = the key/value pairs that are being inserted. If an object or Entity class is passed to the
623624 insert method, it is first converted to an array.
624625afterInsert **id ** = the primary key of the new row, or 0 on failure.
625626 **data ** = the key/value pairs being inserted.
626627 **result ** = the results of the insert() method used through the Query Builder.
628+ beforeInsertBatch **data ** = associative array of values that are being inserted. If an object or Entity class is passed to the
629+ insertBatch method, it is first converted to an array.
630+ afterInsertBatch **data ** = the associative array of values being inserted.
631+ **result ** = the results of the insertbatch() method used through the Query Builder.
627632beforeUpdate **id ** = the array of primary keys of the rows being updated.
628- **data ** = the key/value pairs that are being inserted . If an object or Entity class is passed to the
629- insert method, it is first converted to an array.
633+ **data ** = the key/value pairs that are being updated . If an object or Entity class is passed to the
634+ update method, it is first converted to an array.
630635afterUpdate **id ** = the array of primary keys of the rows being updated.
631636 **data ** = the key/value pairs being updated.
632637 **result ** = the results of the update() method used through the Query Builder.
638+ beforeUpdateBatch **data ** = associative array of values that are being updated. If an object or Entity class is passed to the
639+ updateBatch method, it is first converted to an array.
640+ afterUpdateBatch **data ** = the key/value pairs being updated.
641+ **result ** = the results of the updateBatch() method used through the Query Builder.
633642beforeFind The name of the calling **method **, whether a **singleton ** was requested, and these additional fields:
634643- first() No additional fields
635644- find() **id ** = the primary key of the row being searched for.
@@ -643,7 +652,7 @@ afterDelete **id** = primary key of row being deleted.
643652 **purge ** = boolean whether soft-delete rows should be hard deleted.
644653 **result ** = the result of the delete() call on the Query Builder.
645654 **data ** = unused.
646- ================ =========================================================================================================
655+ ================= =========================================================================================================
647656
648657Modifying Find* Data
649658====================
0 commit comments