public static function saving($callback, $priority = 0) { static::registerModelEvent('saving', $callback, $priority); }
/** * Setting handlers on save Entity */ public static function boot() { parent::boot(); parent::saving(function (Entity $entity) { if (!$entity->exists) { $entity->family_id = $entity->set->getNewSet(); } }); parent::created(function (Entity $entity) { $entity->closure->insertNode($entity->id); }); }