From b549a90ac492bca7c6915d66db5677f2b9016def Mon Sep 17 00:00:00 2001 From: Silvio Date: Wed, 17 Nov 2010 16:51:16 -0200 Subject: Offset support --- lib/sfIsisImporterManager.class.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib/sfIsisImporterManager.class.php') 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); -- cgit v1.2.3