Author: mcantelon
Date: Tue Sep  4 00:33:24 2012
New Revision: 12253

Log:
Minor code cleanup.

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

Modified: trunk/lib/task/import/csvAuthorityRecordImportTask.class.php
==============================================================================
--- trunk/lib/task/import/csvAuthorityRecordImportTask.class.php        Tue Sep 
 4 00:02:40 2012        (r12252)
+++ trunk/lib/task/import/csvAuthorityRecordImportTask.class.php        Tue Sep 
 4 00:33:24 2012        (r12253)
@@ -27,9 +27,9 @@
  */
 class csvAuthorityRecordImportTask extends csvImportBaseTask
 {
-  protected $namespace        = 'csv';
-  protected $name             = 'authority-import';
-  protected $briefDescription = 'Import csv authority record data';
+  protected $namespace           = 'csv';
+  protected $name                = 'authority-import';
+  protected $briefDescription    = 'Import csv authority record data';
   protected $detailedDescription = <<<EOF
 Import CSV data
 EOF;
@@ -42,9 +42,24 @@
     parent::configure();
 
     $this->addOptions(array(
-      new sfCommandOption('alias-file', null, 
sfCommandOption::PARAMETER_OPTIONAL, 'CSV file containing aliases.'),
-      new sfCommandOption('relation-file', null, 
sfCommandOption::PARAMETER_OPTIONAL, 'CSV file containing relationships.'),
-      new sfCommandOption('source-name', null, 
sfCommandOption::PARAMETER_OPTIONAL, 'Source name to use when inserting keymap 
entries.')
+      new sfCommandOption(
+        'alias-file',
+        null,
+        sfCommandOption::PARAMETER_OPTIONAL,
+        'CSV file containing aliases.'
+      ),
+      new sfCommandOption(
+        'relation-file',
+        null,
+        sfCommandOption::PARAMETER_OPTIONAL,
+        'CSV file containing relationships.'
+      ),
+      new sfCommandOption(
+        'source-name',
+        null,
+        sfCommandOption::PARAMETER_OPTIONAL,
+        'Source name to use when inserting keymap entries.'
+      )
     ));
   }
 
@@ -136,12 +151,14 @@
         'sourceName' => $sourceName,
         'actorTypes' => $termData['actorTypes'],
         'aliases'    => $aliases,
-        'actorNames'  => array()
+        'actorNames' => array()
       ),
 
       /* import columns that map directory to QubitInformationObject 
properties */
       'standardColumns' => array(
-        'history'
+        'history',
+        'authorizedFormOfName',
+        'datesOfExistence'
       ),
 
       /* import columns that should be redirected to QubitInformationObject
@@ -163,8 +180,6 @@
          ),
       */
       'columnMap' => array(
-        'name' => 'authorizedFormOfName',
-        'dates' => 'datesOfExistence'
       ),
 
       /* import columns that can be added as QubitNote objects */
@@ -176,7 +191,7 @@
 
       /* these values get stored to the rowStatusVars array */
       'variableColumns' => array(
-        'EntityType',
+        'typeOfEntity',
         'email',
         'notes',
         'countryCode',
@@ -193,18 +208,19 @@
         if ($self->object)
         {
           if (
-            isset($self->rowStatusVars['EntityType'])
-            && $self->rowStatusVars['EntityType']
+            isset($self->rowStatusVars['typeOfEntity'])
+            && $self->rowStatusVars['typeOfEntity']
           )
           {
             $entityTypes  = $self->getStatus('actorTypes');
-            $entityType   = 
ucfirst(strtolower($self->rowStatusVars['EntityType']));
+            $entityType   = 
ucfirst(strtolower($self->rowStatusVars['typeOfEntity']));
             $entityTypeId = array_search($entityType, $entityTypes);
+
             if ($entityTypeId)
             {
               $self->object->entityTypeId = $entityTypeId;
             } else {
-              throw new sfException($entityType .' is not a valid actor entity 
type.');
+              throw new sfException($entityType .' is not a valid entity 
type.');
             }
           }
         }
@@ -228,8 +244,8 @@
               // add other name
               $otherName = new QubitOtherName;
               $otherName->objectId = $self->object->id;
-              $otherName->name = $alias['otherName'];
-              $otherName->typeId = QubitTerm::OTHER_FORM_OF_NAME_ID;
+              $otherName->name     = $alias['otherName'];
+              $otherName->typeId   = QubitTerm::OTHER_FORM_OF_NAME_ID;
               $otherName->save();
             }
           }

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