protected function execute() { $this->logger->debug('IMPORT STARTED'); $this->delimiter = Gpf_Csv_ImportExportService::getDelimiter($this->form->getFieldValue("delimiter")); $this->codes = preg_split("/,/", $this->form->getFieldValue("dropModules")); $this->importObjects = Gpf_Db_ImportExport::getImportExportObjects(); $fileUrl = $this->form->getFieldValue("fileName"); if ($this->isPending($fileUrl, $this->_('Check file'))) { $this->checkFile($fileUrl); } $this->sendToImportObjects($fileUrl); $this->logger->debug('IMPORT ENDED'); }
private function addError($message){ if (!$this->errorFile->isExists()) { $this->getCsvFile($this->form->getFieldValue(self::FILENAME), 'a', Gpf_Csv_ImportExportService::getDelimiter($this->form->getFieldValue(self::DELIMITER))); $this->errorFile->writeArray($this->errorHeader); } $this->row[] = $message; $this->errorFile->writeArray($this->row); }