halcyon.datasource.db.beforeInsert

Triggered in October\Rain\Halcyon\Datasource\DbDatasource.

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;
});