Skip to content

Commit

Permalink
Merge pull request #354 from PhilippGrashoff/patch-2
Browse files Browse the repository at this point in the history
beforeInsert/beforeUpdate Note
  • Loading branch information
romaninsh committed Nov 7, 2018
2 parents 42395e1 + 1e26caf commit c870de6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/hooks.rst
Expand Up @@ -106,6 +106,9 @@ The $data argument will contain array of actual data (field=>value) to be saved,
which you can use to withdraw certain fields from actually being saved into the
database (by unsetting it's value).

Note that altering data via $m->set() does not work in beforeInsert and beforeUpdate
hooks, only by altering $data.

afterInsert will receive either $id of new record or null if model couldn't
provide ID field. Also, afterInsert is actually called before
:php:meth:`Model::_reload_after_save` reloading is done.
Expand Down

0 comments on commit c870de6

Please sign in to comment.