Author: mcantelon
Date: Fri Dec 30 23:47:48 2011
New Revision: 10499

Log:
Added import class method for ad-hoc queries.

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

Modified: trunk/lib/task/csvImportTask.class.php
==============================================================================
--- trunk/lib/task/csvImportTask.class.php      Fri Dec 30 22:36:31 2011        
(r10498)
+++ trunk/lib/task/csvImportTask.class.php      Fri Dec 30 23:47:48 2011        
(r10499)
@@ -484,13 +484,21 @@
     }
   }
 
-  public function createOrFetchActor($name, $history = false)
+  public function sqlQuery($query, $params = array())
   {
     $connection = Propel::getConnection();
-    $query = "SELECT id FROM actor_i18n WHERE authorized_form_of_name=?";
     $statement = $connection->prepare($query);
-    $statement->bindValue(1, $name);
+    for($index = 0; $index < sizeof($params); $index++) {
+      $statement->bindValue($index + 1, $params[$index]);
+    }
     $statement->execute();
+    return $statement;
+  }
+
+  public function createOrFetchActor($name, $history = false)
+  {
+    $query = "SELECT id FROM actor_i18n WHERE authorized_form_of_name=?";
+    $statement = $this->sqlQuery($query, array($name));
     $result = $statement->fetch(PDO::FETCH_OBJ);
     if ($result)
     {

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