Author: mcantelon
Date: Wed Apr  4 17:11:20 2012
New Revision: 11383

Log:
Put back in acceptsOption method and fixed issue with warning.

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

Modified: trunk/lib/task/import/csvImportBaseTask.class.php
==============================================================================
--- trunk/lib/task/import/csvImportBaseTask.class.php   Wed Apr  4 17:06:31 
2012        (r11382)
+++ trunk/lib/task/import/csvImportBaseTask.class.php   Wed Apr  4 17:11:20 
2012        (r11383)
@@ -68,7 +68,7 @@
       throw new sfException('Path to error log is invalid.');
     }
 
-    if (isset($options['source-name']) && !$options['source-name'])
+    if ($this->acceptsOption('source-name') && !$options['source-name'])
     {
       print "WARNING: If you're importing multiple CSV files as part of the "
         ."same import it's advisable to use the source-name CLI option to "
@@ -76,4 +76,20 @@
         . "source name).\n";
     }
   }
+
+  /**
+   * Checks to see if a particular option is supported
+   *
+   * @param string $name  option name
+   *
+   * @return boolean
+   */
+  protected function acceptsOption($name)
+  {
+    foreach($this->getOptions() as $option)
+    {
+      if ($name == $option->getName()) return TRUE;
+    }
+    return FALSE;
+  }
 }

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