Author: mcantelon
Date: Wed Jan 11 17:26:42 2012
New Revision: 10651

Log:
Changed name of logic properties to clarify functionality.

Modified:
   trunk/lib/QubitFlatfileImport.class.php

Modified: trunk/lib/QubitFlatfileImport.class.php
==============================================================================
--- trunk/lib/QubitFlatfileImport.class.php     Wed Jan 11 16:57:21 2012        
(r10650)
+++ trunk/lib/QubitFlatfileImport.class.php     Wed Jan 11 17:26:42 2012        
(r10651)
@@ -40,6 +40,7 @@
 
     $allowedOptions = array(
       'className',
+      'rowInitLogic',
       'rowsUntilProgressDisplay',
       'status',
       'ignoreColumns',
@@ -49,6 +50,7 @@
       'testing',
       'preSaveLogic',
       'postSaveLogic',
+      'saveLogic',
       'propertyMap',
       'noteMap',
       'columnMap',
@@ -383,8 +385,15 @@
 
   public function row($row = array())
   {
-    // create new object
-    $this->object = new $this->className;
+    if (isset($this->className))
+    {
+      // create new object
+      $this->object = new $this->className;
+    } else {
+      // execute ad-hoc row initialization logic (which can make objects, load
+      // them, etc.)
+      $this->executeClosurePropertyIfSet('rowInitLogic');
+    }
 
     // set fields in information object and execute custom column handlers
     $this->rowProcessingBeforeSave($row);
@@ -392,14 +401,20 @@
     // execute pre-save ad-hoc import logic
     $this->executeClosurePropertyIfSet('preSaveLogic');
 
-    // if not in testing mode, save object
-    if (!isset($this->testing) || !$this->testing)
+    if (isset($this->className))
     {
-      $this->object->save();
-    }
+      // if not in testing mode, save object
+      if (!isset($this->testing) || !$this->testing)
+      {
+        $this->object->save();
+      }
 
-    // execute row completion logic
-    $this->executeClosurePropertyIfSet('postSaveLogic');
+      // execute row completion logic
+      $this->executeClosurePropertyIfSet('postSaveLogic');
+    } else {
+      // execute row completion logic
+      $this->executeClosurePropertyIfSet('saveLogic');
+    }
 
     // execute post-save ad-hoc import logic
 

-- 
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