I want to create an observer to execute when the import product is executing, i need persist product informations in another table when the export action is in process, i try the following:
CatalogProductImportBunchSaveAfter
<?php
namespace Module\Imports\Observer;
use Magento\Framework\Event\ObserverInterface;
use Webkul\Marketplace\Model\ResourceModel\Product\CollectionFactory;
class CatalogProductImportBunchSaveAfter implements \Magento\Framework\Event\ObserverInterface {
protected $_objectManager;
protected $_collectionFactory;
protected $_date;
public function __construct(
\Magento\Framework\ObjectManagerInterface $objectManager,
\Magento\Framework\Stdlib\DateTime\DateTime $date,
CollectionFactory $collectionFactory
) {
$this->_objectManager = $objectManager;
$this->_collectionFactory = $collectionFactory;
$this->_date = $date;
}
public function execute(\Magento\Framework\Event\Observer $observer)
{
//my logic to persist new data here;
}
but, i dont now if this is ok. How can i recover all products informations on this observer?