Skip to content

Commit d41ef30

Browse files
committed
Update documentation
1 parent ca47d16 commit d41ef30

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

user_guide_src/source/models/model.rst

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,8 @@ Model Events
579579
There are several points within the model's execution that you can specify multiple callback methods to run.
580580
These methods can be used to normalize data, hash passwords, save related entities, and much more. The following
581581
points 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

584585
Defining Callbacks
585586
==================
@@ -616,20 +617,28 @@ Event Parameters
616617
Since the exact data passed to each callback varies a bit, here are the details on what is in the ``$data`` parameter
617618
passed to each event:
618619

619-
================ =========================================================================================================
620-
Event $data contents
621-
================ =========================================================================================================
620+
================= =========================================================================================================
621+
Event $data contents
622+
================= =========================================================================================================
622623
beforeInsert **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.
624625
afterInsert **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.
627632
beforeUpdate **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.
630635
afterUpdate **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.
633642
beforeFind 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

648657
Modifying Find* Data
649658
====================

0 commit comments

Comments
 (0)