halcyon.datasource.db.beforeInsert
Provides an opportunity to modify records before being inserted into the DB
Example usage:
$datasource->bindEvent('halcyon.datasource.db.beforeInsert', function ((array) &$record) { // Attach a site id to every record in a multi-tenant application $record['site_id'] = SiteManager::getSite()->id; });
Usage
Globally
use Event;
Event::listen('halcyon.datasource.db.beforeInsert', function () {
// Your event listener code goes here...
});
Triggers
Class or file | Line |
---|---|
Winter\Storm\Halcyon\Datasource\DbDatasource
|
245 |
Copyright © 2023 Winter CMS