Author: mcantelon
Date: Wed Jan 18 12:03:53 2012
New Revision: 10714
Log:
Got rid of some redundant logic.
Modified:
trunk/lib/QubitFlatfileImport.class.php
Modified: trunk/lib/QubitFlatfileImport.class.php
==============================================================================
--- trunk/lib/QubitFlatfileImport.class.php Wed Jan 18 11:44:35 2012
(r10713)
+++ trunk/lib/QubitFlatfileImport.class.php Wed Jan 18 12:03:53 2012
(r10714)
@@ -582,20 +582,31 @@
*/
/**
+ * Return an array of columns that are handled by import logic
+ *
+ * @return array array of column names
+ */
+ public function handledOrIgnoredColumns()
+ {
+ return $this->combineArraysWithoutDuplicates(
+ $this->standardColumns,
+ $this->variableColumns,
+ array_keys($this->columnMap),
+ array_keys($this->handlers),
+ array_keys($this->propertyMap),
+ array_keys($this->noteMap),
+ array_keys($this->arrayColumns)
+ );
+ }
+
+ /**
* Determine whether columns isn't handled by import logic
*
* @return boolean TRUE if column not handled by import logic
*/
public function unhandledColumn($column)
{
- return !in_array($column, $this->ignoreColumns)
- && !in_array($column, $this->standardColumns)
- && !isset($this->columnMap[$column])
- && !isset($this->propertyMap[$column])
- && !isset($this->noteMap[$column])
- && !isset($this->handlers[$column])
- && !in_array($column, $this->variableColumns)
- && !isset($this->arrayColumns[$column]);
+ return !in_array($column, $this->handledOrIgnoredColumns());
}
/**
@@ -607,7 +618,7 @@
{
$unmatchedColumns = array();
- foreach($this->handledColumns() as $handledColumn)
+ foreach($this->handledOrIgnoredColumns() as $handledColumn)
{
if (!in_array($handledColumn, $this->columnNames))
array_push($unmatchedColumns, $handledColumn);
}
@@ -616,24 +627,6 @@
}
/**
- * Return an array of columns that are handled by import logic
- *
- * @return array array of column names
- */
- public function handledColumns()
- {
- return $this->combineArraysWithoutDuplicates(
- $this->standardColumns,
- $this->variableColumns,
- array_keys($this->columnMap),
- array_keys($this->handlers),
- array_keys($this->propertyMap),
- array_keys($this->noteMap),
- array_keys($this->arrayColumns)
- );
- }
-
- /**
* Return an array of columns that are included in the import but not
* handled by logic.
*
--
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.