BlackbitDigitalCommerce / pimcore-data-director

Import Bundle for Pimcore
16 stars 3 forks source link

Way to check that events is runned within DataDirector import #78

Open betterapp opened 1 year ago

betterapp commented 1 year ago

Hello

We got some EventListener for object that we do not want to use when data are imported by DataDirector. Is it possible and how ?

BlackbitDevs commented 1 year ago

For pimcore.dataobject.postUpdate event? I can add an argument dataportId to the DataObjectEvent. In your event listener you could access it via

public function handleSave(Pimcore\Event\Model\DataObjectEvent $e) {
  $gotSavedByDataDirector = $e->hasArgument('dataportId');
}

Would this help?

betterapp commented 1 year ago

Perfect.

BlackbitDevs commented 1 year ago

Ok, will add this to 3.3.1.

BlackbitDevs commented 1 year ago

Is implemented. Can you please try 3.3.x-dev?