model.beforeDelete

Called before the model is deleted

Note: also triggered in Winter\Storm\Halcyon\Model

Example usage:

$model->bindEvent('model.beforeDelete', function () use (\Winter\Storm\Database\Model $model) { if (!$model->isAllowedToBeDeleted()) { throw new \Exception("You cannot delete me!"); } });

Usage

Triggers

Class or file Line
Winter\Storm\Database\Model 423
Copyright © 2024 Winter CMS