Author: mcantelon
Date: Tue Jan 10 16:53:56 2012
New Revision: 10640
Log:
Minor refactoring and got rid of a couple orphaned column handlers.
Modified:
trunk/lib/task/csvImportTask.class.php
Modified: trunk/lib/task/csvImportTask.class.php
==============================================================================
--- trunk/lib/task/csvImportTask.class.php Tue Jan 10 16:35:45 2012
(r10639)
+++ trunk/lib/task/csvImportTask.class.php Tue Jan 10 16:53:56 2012
(r10640)
@@ -44,8 +44,8 @@
new sfCommandOption('skip-rows', null,
sfCommandOption::PARAMETER_OPTIONAL, 'Skip n rows before importing.')
));
- $this->namespace = 'csv';
- $this->name = 'import';
+ $this->namespace = 'csv';
+ $this->name = 'import';
$this->briefDescription = 'Import csv data';
$this->detailedDescription = <<<EOF
@@ -69,10 +69,7 @@
return $taxonomyTerms;
}
- /**
- * @see sfTask
- */
- public function execute($arguments = array(), $options = array())
+ protected function validateOptions($options)
{
if ($options['rows-until-update'] &&
!is_numeric($options['rows-until-update']))
{
@@ -83,6 +80,14 @@
{
throw new sfException('skip-rows must be an integer');
}
+ }
+
+ /**
+ * @see sfTask
+ */
+ public function execute($arguments = array(), $options = array())
+ {
+ $this->validateOptions($options);
$skipRows = ($options['skip-rows']) ? $options['skip-rows'] : 0;
@@ -94,6 +99,7 @@
$databaseManager = new sfDatabaseManager($this->configuration);
$conn = $databaseManager->getDatabase('propel')->getConnection();
+ // set default publishing status
$defaultStatusId = sfConfig::get(
'app_defaultPubStatus',
QubitTerm::PUBLICATION_STATUS_PUBLISHED_ID
@@ -177,9 +183,7 @@
/* import columns that can be added using the
QubitInformationObject::addProperty method */
'propertyMap' => array(
- 'titleStatementOfResponsibility' => 'titleStatementOfResponsibility',
'radNoteStatementOfResponsibility' =>
'statementOfResponsibilityRelatingToPublishersSeries',
- 'titleProperOfPublishersSeries' => 'titleProperOfPublishersSeries',
'statementOfScaleArchitectural' => 'statementOfScaleArchitectural',
'statementOfScaleCartographic' => 'statementOfScaleCartographic',
'radTitleProperOfPublishersSeries' => 'titleProperOfPublishersSeries'
--
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.