<?php
namespace Blackbit\DataDirectorBundle\EventListener;
use Blackbit\DataDirectorBundle\lib\Pim\DummyDeepCopy;
use Blackbit\DataDirectorBundle\lib\Pim\Item\Importer;
use Pimcore\Model\Element\DeepCopy\UnmarshalMatcher;
use Pimcore\Model\Element\ElementDescriptor;
use Pimcore\Model\Element\Service;
use Symfony\Component\EventDispatcher\GenericEvent;
class DeepCopyListener
{
/**
* @param GenericEvent $e
* @return void
*/
public function getDeepCopyInstance($e) {
try {
$context = $e->getArgument('context');
if (($context['conversion'] ?? null) === 'unmarshal') {
return;
}
} catch(\InvalidArgumentException $e) {}
if(Importer::isImportWithoutCompatibilityModeRunning()) {
$e->setArgument('copier', new DummyDeepCopy());
}
}
}