Remove now-unused addField from Custom import
authorEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 17 Aug 2022 02:22:29 +0000 (14:22 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 17 Aug 2022 02:22:29 +0000 (14:22 +1200)
CRM/Custom/Import/Field.php [deleted file]
CRM/Custom/Import/Parser/Api.php

diff --git a/CRM/Custom/Import/Field.php b/CRM/Custom/Import/Field.php
deleted file mode 100644 (file)
index 6b005d3..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-/*
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC. All rights reserved.                        |
- |                                                                    |
- | This work is published under the GNU AGPLv3 license with some      |
- | permitted exceptions and without any warranty. For full license    |
- | and copyright information, see https://civicrm.org/licensing       |
- +--------------------------------------------------------------------+
- */
-
-/**
- * Class CRM_Custom_Import_Field
- */
-class CRM_Custom_Import_Field extends CRM_Contact_Import_Field {
-}
index 6fc4f41a06cafc9b231ca5ffcf6b78fe3a13b3bb..8cc441d1f78272f92c22eed46f4de4c1d667c677 100644 (file)
@@ -29,26 +29,6 @@ class CRM_Custom_Import_Parser_Api extends CRM_Import_Parser {
     ];
   }
 
-  /**
-   * The initializer code, called before the processing
-   *
-   * @return void
-   */
-  public function init() {
-    // Force user job to reload.
-    unset($this->userJob);
-    $this->setFieldMetadata();
-    $fields = $this->importableFieldsMetadata;
-    $hasLocationType = FALSE;
-
-    foreach ($fields as $name => $field) {
-      $field['type'] = CRM_Utils_Array::value('type', $field, CRM_Utils_Type::T_INT);
-      $field['dataPattern'] = CRM_Utils_Array::value('dataPattern', $field, '//');
-      $field['headerPattern'] = CRM_Utils_Array::value('headerPattern', $field, '//');
-      $this->addField($name, $field['title'], $field['type'], $field['headerPattern'], $field['dataPattern'], $hasLocationType);
-    }
-  }
-
   /**
    * Main import function.
    *
@@ -167,7 +147,7 @@ class CRM_Custom_Import_Parser_Api extends CRM_Import_Parser {
               if ((strtolower($v2['label']) == strtolower(trim($v1))) ||
                 (strtolower($v2['value']) == strtolower(trim($v1)))
               ) {
-                if ($htmlType == 'CheckBox') {
+                if ($htmlType === 'CheckBox') {
                   $params[$key][$v2['value']] = $formatted[$key][$v2['value']] = 1;
                 }
                 else {
@@ -233,26 +213,4 @@ class CRM_Custom_Import_Parser_Api extends CRM_Import_Parser {
     return $importableFields;
   }
 
-  /**
-   * @deprecated stores metadata in the old format that
-   * a few functions in the parent class still use.
-   *
-   * @param string $name
-   * @param $title
-   * @param int $type
-   * @param string $headerPattern
-   * @param string $dataPattern
-   * @param bool $hasLocationType
-   */
-  private function addField(
-    $name, $title, $type = CRM_Utils_Type::T_INT,
-    $headerPattern = '//', $dataPattern = '//',
-    $hasLocationType = FALSE
-  ) {
-    $this->_fields[$name] = new CRM_Custom_Import_Field($name, $title, $type, $headerPattern, $dataPattern, $hasLocationType);
-    if (empty($name)) {
-      $this->_fields['doNotImport'] = new CRM_Custom_Import_Field($name, $title, $type, $headerPattern, $dataPattern, $hasLocationType);
-    }
-  }
-
 }