/** * Writes articles into the database * * @param array $records * @throws \Exception * @throws AdapterException */ public function write($records) { //articles if (empty($records['article'])) { $message = $this->snippetHelper->getNamespace()->get('adapters/articles/no_records', 'No article records were found.'); throw new \Exception($message); } $records = $this->eventManager->filter('Shopware_Components_SwagImportExport_DbAdapters_ArticlesDbAdapter_Write', $records, ['subject' => $this]); $this->performImport($records); }
/** * @param string $event * @param mixed $value * @param null $eventArgs * @return mixed * @throws \Enlight_Event_Exception */ public function filter($event, $value, $eventArgs = null) { $afterValue = parent::filter($event, $value, $eventArgs); $this->calledEvents[] = ['type' => 'filter', 'name' => $event, 'args' => Debug::dump($eventArgs, 2, true, false), 'old' => is_object($value) ? Debug::dump($value, 2, true, false) : $value, 'new' => is_object($afterValue) ? Debug::dump($afterValue, 2, true, false) : $afterValue]; return $afterValue; }