PHP code example of illusiard / yii2-mass-event-layer
1. Go to this page and download the library: Download illusiard/yii2-mass-event-layer library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
illusiard / yii2-mass-event-layer example snippets
Event::on(MassEventLayer::class, MassEventLayer::EVENT_ANY, function ($e) {
/** @var \illusiard\massEvents\components\MassEventYiiEvent $e */
// handle any mass event
});
use illusiard\massEvents\components\filters\IgnoreTablesFilter;
use illusiard\massEvents\components\filters\IgnoreSqlPatternsFilter;
use illusiard\massEvents\components\filters\SamplingFilter;
Yii::$app->massEvents->setFilters([
new IgnoreTablesFilter(['migration', 'cache']),
new IgnoreSqlPatternsFilter(['/^\s*SELECT\b/i']),
new SamplingFilter(0.25),
]);