X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContribute%2FImport%2FParser.php;h=d7deb54ea17a29993359d060376ad8ec4c21f4d0;hb=76f1a3f2a53b1a3a03df8cf3ff33a1a32c84cc6b;hp=a81b4de3c8ad2c7a3b070e48adf88d12acb63555;hpb=b67022d16d25106799f57d39e9301b3f00af619c;p=civicrm-core.git diff --git a/CRM/Contribute/Import/Parser.php b/CRM/Contribute/Import/Parser.php index a81b4de3c8..d7deb54ea1 100644 --- a/CRM/Contribute/Import/Parser.php +++ b/CRM/Contribute/Import/Parser.php @@ -1,7 +1,7 @@ _duplicateFileName, $headers, $this->_duplicates); } } - //echo "$this->_totalCount,$this->_invalidRowCount,$this->_conflictCount,$this->_duplicateCount"; return $this->fini(); } @@ -399,10 +404,9 @@ abstract class CRM_Contribute_Import_Parser extends CRM_Import_Parser { * * @param array mapped array of values * -pppp * @return void - * @access public + * @return void */ - function setActiveFields($fieldKeys) { + public function setActiveFields($fieldKeys) { $this->_activeFieldCount = count($fieldKeys); foreach ($fieldKeys as $key) { if (empty($this->_fields[$key])) { @@ -414,24 +418,30 @@ pppp * @return void } } - function setActiveFieldSoftCredit($elements) { + /** + * @param array $elements + */ + public function setActiveFieldSoftCredit($elements) { for ($i = 0; $i < count($elements); $i++) { $this->_activeFields[$i]->_softCreditField = $elements[$i]; } } - function setActiveFieldSoftCreditType($elements) { + /** + * @param array $elements + */ + public function setActiveFieldSoftCreditType($elements) { for ($i = 0; $i < count($elements); $i++) { $this->_activeFields[$i]->_softCreditType = $elements[$i]; } } + /** - * 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() { + public function &getActiveFieldParams() { $params = array(); for ($i = 0; $i < $this->_activeFieldCount; $i++) { if (isset($this->_activeFields[$i]->_value)) { @@ -455,7 +465,14 @@ pppp * @return void return $params; } - function addField($name, $title, $type = CRM_Utils_Type::T_INT, $headerPattern = '//', $dataPattern = '//') { + /** + * @param string $name + * @param $title + * @param int $type + * @param string $headerPattern + * @param string $dataPattern + */ + public function addField($name, $title, $type = CRM_Utils_Type::T_INT, $headerPattern = '//', $dataPattern = '//') { if (empty($name)) { $this->_fields['doNotImport'] = new CRM_Contribute_Import_Field($name, $title, $type, $headerPattern, $dataPattern); } @@ -477,10 +494,11 @@ pppp * @return void * * @param CRM_Core_Session $store * + * @param int $mode + * * @return void - * @access public */ - function set($store, $mode = self::MODE_SUMMARY) { + public function set($store, $mode = self::MODE_SUMMARY) { $store->set('fileSize', $this->_fileSize); $store->set('lineCount', $this->_lineCount); $store->set('seperator', $this->_seperator); @@ -537,20 +555,18 @@ pppp * @return void $store->set('duplicatesFileName', $this->_duplicateFileName); } } - //echo "$this->_totalCount,$this->_invalidRowCount,$this->_conflictCount,$this->_duplicateCount"; } /** * 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 */ - static function exportCSV($fileName, $header, $data) { + public static function exportCSV($fileName, $header, $data) { $output = array(); $fd = fopen($fileName, 'w'); @@ -580,7 +596,14 @@ pppp * @return void fclose($fd); } - static function errorFileName($type) { + /** + * Determines the file extension based on error code + * + * @param int $type error code constant + * + * @return string + */ + public static function errorFileName($type) { $fileName = NULL; if (empty($type)) { return $fileName; @@ -606,7 +629,14 @@ pppp * @return void return $fileName; } - static function saveFileName($type) { + /** + * Determines the file name based on error code + * + * @param int $type error code constant + * + * @return string + */ + public static function saveFileName($type) { $fileName = NULL; if (empty($type)) { return $fileName; @@ -629,4 +659,3 @@ pppp * @return void return $fileName; } } -