X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FImport%2FParser.php;h=31c1d63d640ca5e44d04e3f5a4c72a3d35e024f8;hb=6d699851d58b6116417dd95d5821e1cdbdfe7e42;hp=d506c725b7a0288e5cf6d66e62ef333cf57e3a17;hpb=22fd90d480014f0a551b25bea675a03d2153de78;p=civicrm-core.git diff --git a/CRM/Import/Parser.php b/CRM/Import/Parser.php index d506c725b7..31c1d63d64 100644 --- a/CRM/Import/Parser.php +++ b/CRM/Import/Parser.php @@ -1,7 +1,7 @@ _maxLinesToProcess = 0; $this->_maxErrorCount = self::MAX_ERRORS; } /** - * Abstract function definitions + * Abstract function definitions. */ - abstract function init(); + abstract protected function init(); /** * @return mixed */ - abstract function fini(); + abstract protected function fini(); /** * @param $values * * @return mixed */ - abstract function mapField(&$values); + abstract protected function mapField(&$values); /** * @param $values * * @return mixed */ - abstract function preview(&$values); + abstract protected function preview(&$values); /** * @param $values * * @return mixed */ - abstract function summary(&$values); + abstract protected function summary(&$values); /** * @param $onDuplicate @@ -230,17 +228,19 @@ abstract class CRM_Import_Parser { * * @return mixed */ - abstract function import($onDuplicate, &$values); + abstract protected function import($onDuplicate, &$values); /** - * Set and validate field values + * Set and validate field values. * - * @param $elements : array - * @param $erroneousField : reference + * @param array $elements + * array. + * @param $erroneousField + * reference. * * @return int */ - function setActiveFieldValues($elements, &$erroneousField) { + public function setActiveFieldValues($elements, &$erroneousField) { $maxCount = count($elements) < $this->_activeFieldCount ? count($elements) : $this->_activeFieldCount; for ($i = 0; $i < $maxCount; $i++) { $this->_activeFields[$i]->setValue($elements[$i]); @@ -265,12 +265,12 @@ abstract class CRM_Import_Parser { } /** - * 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 + * @return array + * (reference) associative array of name/value pairs */ - function &getActiveFieldParams() { + public function &getActiveFieldParams() { $params = array(); for ($i = 0; $i < $this->_activeFieldCount; $i++) { if (isset($this->_activeFields[$i]->_value) @@ -287,7 +287,7 @@ abstract class CRM_Import_Parser { /** * @return array */ - function getSelectValues() { + public function getSelectValues() { $values = array(); foreach ($this->_fields as $name => $field) { $values[$name] = $field->_title; @@ -298,7 +298,7 @@ abstract class CRM_Import_Parser { /** * @return array */ - function getSelectTypes() { + public function getSelectTypes() { $values = array(); foreach ($this->_fields as $name => $field) { if (isset($field->_hasLocationType)) { @@ -311,7 +311,7 @@ abstract class CRM_Import_Parser { /** * @return array */ - function getHeaderPatterns() { + public function getHeaderPatterns() { $values = array(); foreach ($this->_fields as $name => $field) { if (isset($field->_headerPattern)) { @@ -324,7 +324,7 @@ abstract class CRM_Import_Parser { /** * @return array */ - function getDataPatterns() { + public function getDataPatterns() { $values = array(); foreach ($this->_fields as $name => $field) { $values[$name] = $field->_dataPattern; @@ -339,10 +339,8 @@ abstract class CRM_Import_Parser { * @param string $enclosure * * @return void - * @static - * @access public */ - static function encloseScrub(&$values, $enclosure = "'") { + public static function encloseScrub(&$values, $enclosure = "'") { if (empty($values)) { return; } @@ -353,25 +351,23 @@ abstract class CRM_Import_Parser { } /** - * Setter function + * Setter function. * * @param int $max * * @return void - * @access public */ - function setMaxLinesToProcess($max) { + public function setMaxLinesToProcess($max) { $this->_maxLinesToProcess = $max; } /** - * Determines the file extension based on error code + * Determines the file extension based on error code. * * @var $type error code constant * @return string - * @static */ - static function errorFileName($type) { + public static function errorFileName($type) { $fileName = NULL; if (empty($type)) { return $fileName; @@ -405,13 +401,12 @@ abstract class CRM_Import_Parser { } /** - * Determines the file name based on error code + * Determines the file name based on error code. * * @var $type error code constant * @return string - * @static */ - static function saveFileName($type) { + public static function saveFileName($type) { $fileName = NULL; if (empty($type)) { return $fileName;