Author: mcantelon
Date: Thu Dec 29 15:47:52 2011
New Revision: 10477

Log:
Added class method to help with importing multiple columns to the same Qubit 
field.

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

Modified: trunk/lib/task/csvImportTask.class.php
==============================================================================
--- trunk/lib/task/csvImportTask.class.php      Thu Dec 29 15:35:07 2011        
(r10476)
+++ trunk/lib/task/csvImportTask.class.php      Thu Dec 29 15:47:52 2011        
(r10477)
@@ -88,8 +88,12 @@
         'FINDING AIDS' => 'findingAids',
         'Revision history' => array(
           'column' => 'revision',
-          'transformationLogic' => function(&$self, $text) {
-             return $self->informationObject->revision . $text ."\n";
+          'transformationLogic' => function(&$self, $text)
+          {
+            return $self->appendWithLineBreakIfNeeded(
+              $self->informationObject->revision,
+              $text
+            );
           }
         ),
         '???' => 'physicalCharacteristics'
@@ -299,7 +303,6 @@
           {
             $self->informationObject->{$self->columnMap[$columnName]['column']}
               = $self->columnMap[$columnName]['transformationLogic'](&$self, 
$value);
-print "Did ONE\n";
           } else {
             
$self->informationObject->{$self->columnMap[$columnName]['column']} = $value;
           }
@@ -388,4 +391,9 @@
       $date->save();
     }
   }
+
+  public function appendWithLineBreakIfNeeded($oldContent, $newContent)
+  {
+    return ($oldContent) ? $oldContent ."\n". $newContent : $newContent;
+  }
 }

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