halcyon.datasource.db.extendQuery

Provides an opportunity to modify the query object used by the Halycon DbDatasource

Example usage:

$datasource->bindEvent('halcyon.datasource.db.extendQuery', function ((QueryBuilder) $query, (bool) $ignoreDeleted) { // Apply a site filter in a multi-tenant application $query->where('site_id', SiteManager::getSite()->id); });

Usage

Globally

use Event;

Event::listen('halcyon.datasource.db.extendQuery', function () {
    // Your event listener code goes here...
});

Triggers

Copyright © 2024 Winter CMS