/**
  * Dispatch event
  *
  * @param array $configuration
  * @param Observer $observer
  * @return void
  */
 public function dispatch(array $configuration, Observer $observer)
 {
     /** Check whether event observer is disabled */
     if (isset($configuration['disabled']) && true === $configuration['disabled']) {
         return;
     }
     if (isset($configuration['shared']) && false === $configuration['shared']) {
         $object = $this->_observerFactory->create($configuration['instance']);
     } else {
         $object = $this->_observerFactory->get($configuration['instance']);
     }
     $this->_devHelper->setObserverDetails($configuration, get_class($object));
     $this->_callObserverMethod($object, $configuration['method'], $observer);
 }
 public function dispatch($eventName, array $data = [])
 {
     \Magento\Framework\Profiler::start('EVENT:' . $eventName, ['group' => 'EVENT', 'name' => $eventName]);
     foreach ($this->_eventConfig->getObservers($eventName) as $observerConfig) {
         $event = new \Magento\Framework\Event($data);
         $event->setName($eventName);
         $wrapper = new \Magento\Framework\Event\Observer();
         $wrapper->setData(array_merge(['event' => $event], $data));
         \Magento\Framework\Profiler::start('OBSERVER:' . $observerConfig['name']);
         $this->_invoker->dispatch($observerConfig, $wrapper);
         $this->_devHelper->setObserverDetails($observerConfig, $eventName);
         \Magento\Framework\Profiler::stop('OBSERVER:' . $observerConfig['name']);
     }
     \Magento\Framework\Profiler::stop('EVENT:' . $eventName);
 }
 /**
  * Retrun all the details related to collection on a particular page load
  */
 public function getCollectionDetails()
 {
     return $this->_devToolHelper->getDevToolData($this->_devToolHelper->_collectionKey);
 }
 /**
  * Function for getting event details
  * @return array
  */
 public function getEventDetails()
 {
     return $this->_devToolHelper->getEventDetails();
 }
 /**
  * Retrun all the details related to Module/Controller/Action on a particular page load
  */
 public function getRequestDetails()
 {
     return $this->_devToolHelper->getDevToolData($this->_devToolHelper->_requestKey);
 }
 /**
  * Retrun all the details related to Models on a particular page load
  */
 public function getModelDetails()
 {
     return $this->_devToolHelper->getDevToolData($this->_devToolHelper->_modelKey);
 }