Cancel $model->save($data) operation using $beforeInsert |
@littlej you cannot cancel an insert, partly because Events are potentially a chain spa ll need to return the data, transformed or not, for the next event. If I were you, I would extend the model and make my own insert() method something like this:
PHP Code: public function insert($data = null, bool $returnID = true) And then you can define your own exception CancelEventException and throw it from uniqueTokenPerUser() Sorry about the formatting, the forum software is freaking out on me. |
Messages In This Thread |
Cancel $model->save($data) operation using $beforeInsert - by littlej - 01-06-2020, 04:51 AM
RE: Cancel $model->save($data) operation using $beforeInsert - by InsiteFX - 01-06-2020, 09:05 AM
RE: Cancel $model->save($data) operation using $beforeInsert - by littlej - 01-06-2020, 09:42 AM
RE: Cancel $model->save($data) operation using $beforeInsert - by MGatner - 01-07-2020, 12:31 PM
RE: Cancel $model->save($data) operation using $beforeInsert - by littlej - 01-07-2020, 03:50 PM
RE: Cancel $model->save($data) operation using $beforeInsert - by abatrans - 01-13-2020, 07:42 AM
RE: Cancel $model->save($data) operation using $beforeInsert - by littlej - 01-13-2020, 09:08 AM
|