| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
* $Id$
*
*/
-
-
abstract class CRM_Import_Parser {
/**
* Settings
/**
* Class constructor
*/
- function __construct() {
+ public function __construct() {
$this->_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
*
* @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]);
}
/**
- * 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)
/**
* @return array
*/
- function getSelectValues() {
+ public function getSelectValues() {
$values = array();
foreach ($this->_fields as $name => $field) {
$values[$name] = $field->_title;
/**
* @return array
*/
- function getSelectTypes() {
+ public function getSelectTypes() {
$values = array();
foreach ($this->_fields as $name => $field) {
if (isset($field->_hasLocationType)) {
/**
* @return array
*/
- function getHeaderPatterns() {
+ public function getHeaderPatterns() {
$values = array();
foreach ($this->_fields as $name => $field) {
if (isset($field->_headerPattern)) {
/**
* @return array
*/
- function getDataPatterns() {
+ public function getDataPatterns() {
$values = array();
foreach ($this->_fields as $name => $field) {
$values[$name] = $field->_dataPattern;
* @param string $enclosure
*
* @return void
- * @static
- * @access public
*/
- static function encloseScrub(&$values, $enclosure = "'") {
+ public static function encloseScrub(&$values, $enclosure = "'") {
if (empty($values)) {
return;
}
}
/**
- * 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;
}
/**
- * 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;