model.beforeCreate

Called before the model is created

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

Example usage:

$model->bindEvent('model.beforeCreate', function () use (\Winter\Storm\Database\Model $model) { if (!$model->isValid()) { throw new \Exception("Invalid Model!"); } });

Usage

Triggers

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