Author: mcantelon
Date: Mon Jan  2 15:37:23 2012
New Revision: 10521

Log:
Moved access point creation logic into QubitFlatfileImport class method.

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

Modified: trunk/lib/QubitFlatfileImport.class.php
==============================================================================
--- trunk/lib/QubitFlatfileImport.class.php     Mon Jan  2 15:23:21 2012        
(r10520)
+++ trunk/lib/QubitFlatfileImport.class.php     Mon Jan  2 15:37:23 2012        
(r10521)
@@ -301,6 +301,19 @@
     return $actor;
   }
 
+  public function createAccessPoint($taxonomyId, $name)
+  {
+    $term = new QubitTerm();
+    $term->taxonomyId = $taxonomyId;
+    $term->name = $name;
+    $term->save();
+
+    $relation = new QubitObjectTermRelation;
+    $relation->term = $term;
+    $relation->objectId = $this->informationObject->id;
+    $relation->save();
+  }
+
   public function getTaxonomyTerms($taxonomyId, $culture = 'en')
   {
     $terms = array();

Modified: trunk/lib/task/csvImportTask.class.php
==============================================================================
--- trunk/lib/task/csvImportTask.class.php      Mon Jan  2 15:23:21 2012        
(r10520)
+++ trunk/lib/task/csvImportTask.class.php      Mon Jan  2 15:37:23 2012        
(r10521)
@@ -187,15 +187,7 @@
         {
           foreach($self->rowStatusVars['subjectAccessPoints'] as $subject)
           {
-            $term = new QubitTerm();
-            $term->taxonomyId = QubitTaxonomy::SUBJECT_ID;
-            $term->name = $subject;
-            $term->save();
-
-            $relation = new QubitObjectTermRelation;
-            $relation->term = $term;
-            $relation->objectId = $self->informationObject->id;
-            $relation->save();
+            $self->createAccessPoint(QubitTaxonomy::SUBJECT_ID, $subject);
           }
         }
 

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