<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
/**
- * total number of non empty lines
+ * Total number of non empty lines
*/
protected $_totalCount;
/**
- * running total number of valid lines
+ * Running total number of valid lines
*/
protected $_validCount;
/**
- * running total number of invalid rows
+ * Running total number of invalid rows
*/
protected $_invalidRowCount;
/**
- * maximum number of non-empty/comment lines to process
+ * Maximum number of non-empty/comment lines to process
*
* @var int
*/
protected $_maxLinesToProcess;
/**
- * maximum number of invalid rows to store
+ * Maximum number of invalid rows to store
*/
protected $_maxErrorCount;
/**
- * array of error lines, bounded by MAX_ERROR
+ * Array of error lines, bounded by MAX_ERROR
*/
protected $_errors;
/**
- * total number of conflict lines
+ * Total number of conflict lines
*/
protected $_conflictCount;
/**
- * array of conflict lines
+ * Array of conflict lines
*/
protected $_conflicts;
/**
- * total number of duplicate (from database) lines
+ * Total number of duplicate (from database) lines
*/
protected $_duplicateCount;
/**
- * array of duplicate lines
+ * Array of duplicate lines
*/
protected $_duplicates;
/**
- * running total number of warnings
+ * Running total number of warnings
*/
protected $_warningCount;
/**
- * maximum number of warnings to store
+ * Maximum number of warnings to store
*/
protected $_maxWarningCount = self::MAX_WARNINGS;
/**
- * array of warning lines, bounded by MAX_WARNING
+ * Array of warning lines, bounded by MAX_WARNING
*/
protected $_warnings;
/**
- * array of all the fields that could potentially be part
+ * Array of all the fields that could potentially be part
* of this import process
* @var array
*/
protected $_fields;
/**
- * array of the fields that are actually part of the import process
+ * Array of the fields that are actually part of the import process
* the position in the array also dictates their position in the import
* file
* @var array
protected $_activeFields;
/**
- * cache the count of active fields
+ * Cache the count of active fields
*
* @var int
*/
protected $_activeFieldCount;
/**
- * cache of preview rows
+ * Cache of preview rows
*
* @var array
*/
protected $_rows;
/**
- * filename of error data
+ * Filename of error data
*
* @var string
*/
protected $_errorFileName;
/**
- * filename of conflict data
+ * Filename of conflict data
*
* @var string
*/
protected $_conflictFileName;
/**
- * filename of duplicate data
+ * Filename of duplicate data
*
* @var string
*/
protected $_duplicateFileName;
/**
- * contact type
+ * Contact type
*
* @var int
*/
* Abstract function definitions
*/
abstract function init();
+
+ /**
+ * @return mixed
+ */
abstract function fini();
+
+ /**
+ * @param $values
+ *
+ * @return mixed
+ */
abstract function mapField(&$values);
+
+ /**
+ * @param $values
+ *
+ * @return mixed
+ */
abstract function preview(&$values);
+
+ /**
+ * @param $values
+ *
+ * @return mixed
+ */
abstract function summary(&$values);
+
+ /**
+ * @param $onDuplicate
+ * @param $values
+ *
+ * @return mixed
+ */
abstract function import($onDuplicate, &$values);
/**
* Set and validate field values
*
- * @param $elements: array
- * @param $erroneousField: reference
+ * @param $elements : array
+ * @param $erroneousField : reference
+ *
+ * @return int
*/
function setActiveFieldValues($elements, &$erroneousField) {
$maxCount = count($elements) < $this->_activeFieldCount ? count($elements) : $this->_activeFieldCount;
return $params;
}
+ /**
+ * @return array
+ */
function getSelectValues() {
$values = array();
foreach ($this->_fields as $name => $field) {
return $values;
}
+ /**
+ * @return array
+ */
function getSelectTypes() {
$values = array();
foreach ($this->_fields as $name => $field) {
return $values;
}
+ /**
+ * @return array
+ */
function getHeaderPatterns() {
$values = array();
foreach ($this->_fields as $name => $field) {
return $values;
}
+ /**
+ * @return array
+ */
function getDataPatterns() {
$values = array();
foreach ($this->_fields as $name => $field) {
}
/**
- * setter function
+ * Setter function
*
* @param int $max
*