Author: mcantelon
Date: Thu Aug 23 15:22:56 2012
New Revision: 12185

Log:
Added nested set build after import and option to skip it.

Modified:
   trunk/lib/task/import/csvImportTask.class.php

Modified: trunk/lib/task/import/csvImportTask.class.php
==============================================================================
--- trunk/lib/task/import/csvImportTask.class.php       Thu Aug 23 15:19:48 
2012        (r12184)
+++ trunk/lib/task/import/csvImportTask.class.php       Thu Aug 23 15:22:56 
2012        (r12185)
@@ -60,6 +60,12 @@
         null,
         sfCommandOption::PARAMETER_OPTIONAL,
         'Legacy parent ID under which imported items, with no parent 
specified, will be added.'
+      ),
+      new sfCommandOption(
+        'skip-nested-set-build',
+        null,
+        sfCommandOption::PARAMETER_NONE,
+        "Don't build the nested set upon import completion."
       )
     ));
   }
@@ -1000,6 +1006,15 @@
     });
 
     $import->csv($fh, $skipRows);
+
+    // build nested set if desired
+    if (!$options['skip-nested-set-build'])
+    {
+      $buildNestedSet = new propelBuildNestedSetTask($this->dispatcher, 
$this->formatter);
+      $buildNestedSet->setCommandApplication($this->commandApplication);
+      $buildNestedSet->setConfiguration($this->configuration);
+      $ret = $buildNestedSet->run();
+    }
   }
 
 }

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to