aboutsummaryrefslogtreecommitdiff
path: root/lib/sfIsisImporterManager.class.php
diff options
context:
space:
mode:
authorSilvio <silvio@devlet.com.br>2010-11-17 16:51:16 -0200
committerSilvio <silvio@devlet.com.br>2010-11-17 16:51:16 -0200
commitb549a90ac492bca7c6915d66db5677f2b9016def (patch)
tree0f53dc0d1a62742a04ed4cf23d47b849f4d44816 /lib/sfIsisImporterManager.class.php
parentd665bccaa9ea9af94342a4fa96be545dc1dcd571 (diff)
downloadsf_isis_importer_plugin-b549a90ac492bca7c6915d66db5677f2b9016def.tar.gz
sf_isis_importer_plugin-b549a90ac492bca7c6915d66db5677f2b9016def.tar.bz2
Offset support
Diffstat (limited to 'lib/sfIsisImporterManager.class.php')
-rw-r--r--lib/sfIsisImporterManager.class.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/sfIsisImporterManager.class.php b/lib/sfIsisImporterManager.class.php
index 548587e..c08545a 100644
--- a/lib/sfIsisImporterManager.class.php
+++ b/lib/sfIsisImporterManager.class.php
@@ -130,7 +130,7 @@ class sfIsisImporterManager extends IsisConnector
* @param string $section Caller section (whether an action or task)
* @param int $entries Number of entries to import (defaults to all)
*/
- public function massImport($caller, $section, $entries = NULL)
+ public function massImport($caller, $section, $entries = NULL, $offset = 0)
{
// Additional logging settings.
$this->logger->setCaller($caller);
@@ -145,11 +145,12 @@ class sfIsisImporterManager extends IsisConnector
{
// Determine base model and max entries.
$this->log('Starting mass import procedure for database schema "'. $database .'".', 'notice');
- $base_model = $importer->isis->format['import']['base_model'];
- $this->entries = ($entries != NULL && $entries <= $importer->isis->entries) ? $entries : $importer->isis->entries;
+ $base_model = $importer->isis->format['import']['base_model'];
+ $this->max = ($entries != NULL && $entries + $offset <= $importer->isis->entries) ? $entries + $offset : $importer->isis->entries;
- if ($base_model) {
- for ($entry = 1; $entry <= $this->entries; $entry++)
+ if ($base_model)
+ {
+ for ($entry = $offset + 1; $entry <= $this->max; $entry++)
{
$importer->addEntry($base_model, $entry);
$this->progress($entry);