Pimcore
Trigger Events

Pimcore manual events trigger

TL;DR

Trigger DataObject event (opens in a new tab) manually by Pimcore::getEventDispatcher()->dispatch(pim_event, event_type).

Example

After the import, you may need to trigger events manually for all objects, like this

afterImportTriggers.php
use Pimcore;
use Pimcore\Event\DataObjectEvents;
use Pimcore\Event\Model\DataObjectEvent;
 
$products = new Product\Listing();
$products->load();
 
foreach ($products as $i => $product) {
    Pimcore::getEventDispatcher()->dispatch(
        new DataObjectEvent($product),
        DataObjectEvents::POST_UPDATE
    );
}