Author: mcantelon
Date: Fri Dec 30 23:50:01 2011
New Revision: 10500

Log:
Added method to get taxonomy terms (so taxonomy names, rather than numbers, can 
be used when creating imports).

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

Modified: trunk/lib/task/csvImportTask.class.php
==============================================================================
--- trunk/lib/task/csvImportTask.class.php      Fri Dec 30 23:47:48 2011        
(r10499)
+++ trunk/lib/task/csvImportTask.class.php      Fri Dec 30 23:50:01 2011        
(r10500)
@@ -488,7 +488,8 @@
   {
     $connection = Propel::getConnection();
     $statement = $connection->prepare($query);
-    for($index = 0; $index < sizeof($params); $index++) {
+    for($index = 0; $index < sizeof($params); $index++)
+    {
       $statement->bindValue($index + 1, $params[$index]);
     }
     $statement->execute();
@@ -521,6 +522,23 @@
     return $actor;
   }
 
+  public function getTaxomoyTerms($taxonomyId)
+  {
+    $terms = array();
+
+    $query = "SELECT * FROM term t \r
+      LEFT JOIN term_i18n ti ON t.id=ti.id AND ti.culture='en' \r
+      WHERE taxonomy_id=?";
+    $statement = $this->sqlQuery($query, array($taxonomyId));
+
+    while($term = $statement->fetch(PDO::FETCH_OBJ))
+    {
+      $terms[$term->id] = $term;
+    }
+
+    return $terms;
+  }
+
   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