/** * Returns the progress message for the current import step. A Progress-Object will be passed, so * you can get some context info for your snippet * * @param Shopware_Components_Migration_Import_Progress $progress * @return string */ public function getCurrentProgressMessage($progress) { if ($this->getInternalName() == 'import_categories') { return sprintf($this->getNameSpace()->get('progressCategories', "%s out of %s categories imported"), $progress->getOffset(), $progress->getCount()); } elseif ($this->getInternalName() == 'import_article_categories') { return sprintf($this->getNameSpace()->get('progressArticleCategories', "%s out of %s articles assigned to categories"), $progress->getOffset(), $progress->getCount()); } }
/** * Creates an instance of the import resource needed to import $importType * * Will also inject the dependencies needed and return the created object * * @param $importType string The import resource to create * @return Shopware_Components_Migration_Import_Resource_Abstract */ public function initImport($importType) { $offset = empty($this->Request()->offset) ? 0 : (int) $this->Request()->offset; $name = $this->imports[$importType]; /** @var $progress Shopware_Components_Migration_Import_Progress */ $progress = new Shopware_Components_Migration_Import_Progress(); $progress->setOffset($offset); $import = Shopware_Components_Migration::resourceFactory($name, $progress, $this->Source(), $this->Target(), $this->request); $import->setInternalName($importType); $import->setMaxExecution($this->max_execution); return $import; }
/** * Returns the progress message for the current import step. A Progress-Object will be passed, so * you can get some context info for your snippet * * @param Shopware_Components_Migration_Import_Progress $progress * @return string */ public function getCurrentProgressMessage($progress) { return sprintf($this->getNameSpace()->get('progressProducts', "%s out of %s products imported"), $progress->getOffset(), $progress->getCount()); }