<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
*/
/**
- * total number of lines in file
+ * Total number of lines in file
*/
protected $_rowCount;
/**
- * running total number of un matched Conact
+ * Running total number of un matched Conact
*/
protected $_unMatchCount;
/**
- * array of unmatched lines
+ * Array of unmatched lines
*/
protected $_unMatch;
/**
- * total number of contacts with unparsed addresses
+ * Total number of contacts with unparsed addresses
*/
protected $_unparsedAddressCount;
/**
- * filename of mismatch data
+ * Filename of mismatch data
*
* @var string
*/
protected $_statusFieldName;
/**
- * on duplicate
+ * On duplicate
*
* @var int
*/
public $_onDuplicate;
/**
- * dedupe rule group id to use if set
+ * Dedupe rule group id to use if set
*
* @var int
*/
public $_dedupeRuleGroupID = NULL;
+ /**
+ * @param string $tableName
+ * @param $mapper
+ * @param int $mode
+ * @param int $contactType
+ * @param string $primaryKeyName
+ * @param string $statusFieldName
+ * @param int $onDuplicate
+ * @param int $statusID
+ * @param null $totalRowCount
+ * @param bool $doGeocodeAddress
+ * @param int $timeout
+ * @param null $contactSubType
+ * @param int $dedupeRuleGroupID
+ *
+ * @return mixed
+ */
function run($tableName,
&$mapper,
$mode = self::MODE_PREVIEW,
}
}
+ /**
+ * @param $elements
+ */
function setActiveFieldLocationTypes($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_hasLocationType = $elements[$i];
}
}
+ /**
+ * @param $elements
+ */
+ /**
+ * @param $elements
+ */
function setActiveFieldPhoneTypes($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_phoneType = $elements[$i];
}
}
+ /**
+ * @param $elements
+ */
function setActiveFieldWebsiteTypes($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_websiteType = $elements[$i];
}
/**
- * Function to set IM Service Provider type fields
+ * Set IM Service Provider type fields
*
* @param array $elements IM service provider type ids
*
}
}
+ /**
+ * @param $elements
+ */
function setActiveFieldRelated($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_related = $elements[$i];
}
}
+ /**
+ * @param $elements
+ */
function setActiveFieldRelatedContactType($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_relatedContactType = $elements[$i];
}
}
+ /**
+ * @param $elements
+ */
function setActiveFieldRelatedContactDetails($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_relatedContactDetails = $elements[$i];
}
}
+ /**
+ * @param $elements
+ */
function setActiveFieldRelatedContactLocType($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_relatedContactLocType = $elements[$i];
}
}
+ /**
+ * @param $elements
+ */
function setActiveFieldRelatedContactPhoneType($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_relatedContactPhoneType = $elements[$i];
}
}
+ /**
+ * @param $elements
+ */
function setActiveFieldRelatedContactWebsiteType($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_relatedContactWebsiteType = $elements[$i];
}
/**
- * Function to set IM Service Provider type fields for related contacts
+ * Set IM Service Provider type fields for related contacts
*
* @param array $elements IM service provider type ids of related contact
*
}
/**
- * function to format the field values for input to the api
+ * Format the field values for input to the api
*
* @return array (reference ) associative array of name/value pairs
* @access public
function &getActiveFieldParams() {
$params = array();
- //CRM_Core_Error::debug( 'Count', $this->_activeFieldCount );
for ($i = 0; $i < $this->_activeFieldCount; $i++) {
if ($this->_activeFields[$i]->_name == 'do_not_import') {
continue;
}
if (isset($this->_activeFields[$i]->_relatedContactLocType) && !empty($this->_activeFields[$i]->_value)) {
- if (!is_array($params[$this->_activeFields[$i]->_related][$this->_activeFields[$i]->_relatedContactDetails])) {
+ if (!empty($params[$this->_activeFields[$i]->_related][$this->_activeFields[$i]->_relatedContactDetails]) &&
+ !is_array($params[$this->_activeFields[$i]->_related][$this->_activeFields[$i]->_relatedContactDetails])) {
$params[$this->_activeFields[$i]->_related][$this->_activeFields[$i]->_relatedContactDetails] = array();
}
$value = array(
return $params;
}
+ /**
+ * @return array
+ */
function getColumnPatterns() {
$values = array();
foreach ($this->_fields as $name => $field) {
return $values;
}
+ /**
+ * @param string $name
+ * @param $title
+ * @param int $type
+ * @param string $headerPattern
+ * @param string $dataPattern
+ * @param bool $hasLocationType
+ */
function addField($name, $title, $type = CRM_Utils_Type::T_INT,
$headerPattern = '//', $dataPattern = '//',
$hasLocationType = FALSE
*
* @param CRM_Core_Session $store
*
+ * @param int $mode
+ *
* @return void
* @access public
*/
/**
* Export data to a CSV file
*
- * @param string $filename
+ * @param string $fileName
* @param array $header
- * @param data $data
+ * @param array $data
*
* @return void
* @access public