[Import] Add some not-yet-used functions that are prone to conflict
authorEileen McNaughton <emcnaughton@wikimedia.org>
Thu, 26 May 2022 07:09:36 +0000 (19:09 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Thu, 26 May 2022 07:10:37 +0000 (19:10 +1200)
15 files changed:
CRM/Activity/Import/Form/DataSource.php
CRM/Activity/Import/Form/MapField.php
CRM/Activity/Import/Form/Preview.php
CRM/Contribute/Import/Form/DataSource.php
CRM/Contribute/Import/Form/MapField.php
CRM/Contribute/Import/Form/Preview.php
CRM/Custom/Import/Form/DataSource.php
CRM/Custom/Import/Form/Preview.php
CRM/Event/Import/Form/DataSource.php
CRM/Event/Import/Form/MapField.php
CRM/Event/Import/Form/Preview.php
CRM/Import/Forms.php
CRM/Member/Import/Form/DataSource.php
CRM/Member/Import/Form/MapField.php
CRM/Member/Import/Form/Preview.php

index a244cb7e0a86a2bb3f48ad337374d579ee51387f..45838871d920e7b924866046acd6002c3607c212 100644 (file)
@@ -56,4 +56,16 @@ class CRM_Activity_Import_Form_DataSource extends CRM_Import_Form_DataSource {
     $this->submitFileForMapping('CRM_Activity_Import_Parser_Activity');
   }
 
+  /**
+   * @return CRM_Activity_Import_Parser_Activity
+   */
+  protected function getParser(): CRM_Activity_Import_Parser_Activity {
+    if (!$this->parser) {
+      $this->parser = new CRM_Activity_Import_Parser_Activity();
+      $this->parser->setUserJobID($this->getUserJobID());
+      $this->parser->init();
+    }
+    return $this->parser;
+  }
+
 }
index 8008bc0412c4db0252a972b7b99f41e1c52e4191..2dc0f5ce5d6262d8ebfeae4efe557994915b25ea 100644 (file)
@@ -395,4 +395,16 @@ class CRM_Activity_Import_Form_MapField extends CRM_Import_Form_MapField {
     $parser->set($this);
   }
 
+  /**
+   * @return CRM_Activity_Import_Parser_Activity
+   */
+  protected function getParser(): CRM_Activity_Import_Parser_Activity {
+    if (!$this->parser) {
+      $this->parser = new CRM_Activity_Import_Parser_Activity();
+      $this->parser->setUserJobID($this->getUserJobID());
+      $this->parser->init();
+    }
+    return $this->parser;
+  }
+
 }
index 09e5bf2791c21f710d19414076a4d3bd9231e048..f26d7f67f6f716c25c79ed5947a95589eace3114 100644 (file)
@@ -126,4 +126,16 @@ class CRM_Activity_Import_Form_Preview extends CRM_Import_Form_Preview {
     }
   }
 
+  /**
+   * @return CRM_Activity_Import_Parser_Activity
+   */
+  protected function getParser(): CRM_Activity_Import_Parser_Activity {
+    if (!$this->parser) {
+      $this->parser = new CRM_Activity_Import_Parser_Activity();
+      $this->parser->setUserJobID($this->getUserJobID());
+      $this->parser->init();
+    }
+    return $this->parser;
+  }
+
 }
index 37c0191d5ef2c26b8501a783422d7b8ae8654a12..1a6c307fac9d303c441d1c2a62f1b7f9c45b3238 100644 (file)
@@ -59,4 +59,16 @@ class CRM_Contribute_Import_Form_DataSource extends CRM_Import_Form_DataSource {
     $this->submitFileForMapping('CRM_Contribute_Import_Parser_Contribution');
   }
 
+  /**
+   * @return \CRM_Contribute_Import_Parser_Contribution
+   */
+  protected function getParser(): CRM_Contribute_Import_Parser_Contribution {
+    if (!$this->parser) {
+      $this->parser = new CRM_Contribute_Import_Parser_Contribution();
+      $this->parser->setUserJobID($this->getUserJobID());
+      $this->parser->init();
+    }
+    return $this->parser;
+  }
+
 }
index 34567d0874b4709c0432ff0199d4b8fbe2da27b2..e6c4a963ffe0e1bb96e3c1d4730860afecfd8904 100644 (file)
@@ -496,9 +496,12 @@ class CRM_Contribute_Import_Form_MapField extends CRM_Import_Form_MapField {
    * @return \CRM_Contribute_Import_Parser_Contribution
    */
   protected function getParser(): CRM_Contribute_Import_Parser_Contribution {
-    $parser = new CRM_Contribute_Import_Parser_Contribution();
-    $parser->setUserJobID($this->getUserJobID());
-    return $parser;
+    if (!$this->parser) {
+      $this->parser = new CRM_Contribute_Import_Parser_Contribution();
+      $this->parser->setUserJobID($this->getUserJobID());
+      $this->parser->init();
+    }
+    return $this->parser;
   }
 
 }
index 97b64508818993925904002dcbe56374c52a2379..4bb5a55b4c419e0446bd01fb476b01631e86bf43 100644 (file)
@@ -139,4 +139,16 @@ class CRM_Contribute_Import_Form_Preview extends CRM_Import_Form_Preview {
     }
   }
 
+  /**
+   * @return \CRM_Contribute_Import_Parser_Contribution
+   */
+  protected function getParser(): CRM_Contribute_Import_Parser_Contribution {
+    if (!$this->parser) {
+      $this->parser = new CRM_Contribute_Import_Parser_Contribution();
+      $this->parser->setUserJobID($this->getUserJobID());
+      $this->parser->init();
+    }
+    return $this->parser;
+  }
+
 }
index 92514fc07bdef087f213e6ab81a141277d310f22..71b2eb52b96d0f9ab6fbac567e79cb2a31c5c061 100644 (file)
@@ -96,4 +96,16 @@ class CRM_Custom_Import_Form_DataSource extends CRM_Import_Form_DataSource {
     $this->submitFileForMapping('CRM_Custom_Import_Parser_Api', 'multipleCustomData');
   }
 
+  /**
+   * @return CRM_Custom_Import_Parser_Api
+   */
+  protected function getParser(): CRM_Custom_Import_Parser_Api {
+    if (!$this->parser) {
+      $this->parser = new CRM_Custom_Import_Parser_Api();
+      $this->parser->setUserJobID($this->getUserJobID());
+      $this->parser->init();
+    }
+    return $this->parser;
+  }
+
 }
index 6bee78ad9f2eb1785300eb43cbf90fd6a7962497..a9a01a528fe745bedb28b9a3c297fdf7f0f62ee5 100644 (file)
@@ -115,4 +115,16 @@ class CRM_Custom_Import_Form_Preview extends CRM_Import_Form_Preview {
     }
   }
 
+  /**
+   * @return CRM_Custom_Import_Parser_Api
+   */
+  protected function getParser(): CRM_Custom_Import_Parser_Api {
+    if (!$this->parser) {
+      $this->parser = new CRM_Custom_Import_Parser_Api();
+      $this->parser->setUserJobID($this->getUserJobID());
+      $this->parser->init();
+    }
+    return $this->parser;
+  }
+
 }
index c97c9d7fdbe9f080b5c38cf6666251de15648b18..93f8812909948dd9ba83b9cc2df5d662dea223a0 100644 (file)
@@ -59,4 +59,16 @@ class CRM_Event_Import_Form_DataSource extends CRM_Import_Form_DataSource {
     $this->submitFileForMapping('CRM_Event_Import_Parser_Participant');
   }
 
+  /**
+   * @return CRM_Event_Import_Parser_Participant
+   */
+  protected function getParser(): CRM_Event_Import_Parser_Participant {
+    if (!$this->parser) {
+      $this->parser = new CRM_Event_Import_Parser_Participant();
+      $this->parser->setUserJobID($this->getUserJobID());
+      $this->parser->init();
+    }
+    return $this->parser;
+  }
+
 }
index c4907fd2a6eea11df4b05255172abbd38f4faaa7..33228af045114bdd77a9a466fe5263a2e36140d0 100644 (file)
@@ -430,4 +430,16 @@ class CRM_Event_Import_Form_MapField extends CRM_Import_Form_MapField {
     $parser->set($this);
   }
 
+  /**
+   * @return CRM_Event_Import_Parser_Participant
+   */
+  protected function getParser(): CRM_Event_Import_Parser_Participant {
+    if (!$this->parser) {
+      $this->parser = new CRM_Event_Import_Parser_Participant();
+      $this->parser->setUserJobID($this->getUserJobID());
+      $this->parser->init();
+    }
+    return $this->parser;
+  }
+
 }
index b5e0320d1ff5987fed01af4713781645133c3c0f..7456aee9200a87e7aa7722de191958594258edd7 100644 (file)
@@ -128,4 +128,16 @@ class CRM_Event_Import_Form_Preview extends CRM_Import_Form_Preview {
     }
   }
 
+  /**
+   * @return CRM_Event_Import_Parser_Participant
+   */
+  protected function getParser(): CRM_Event_Import_Parser_Participant {
+    if (!$this->parser) {
+      $this->parser = new CRM_Event_Import_Parser_Participant();
+      $this->parser->setUserJobID($this->getUserJobID());
+      $this->parser->init();
+    }
+    return $this->parser;
+  }
+
 }
index e752dc6c830495415ab421bf787afbcf68eaeb34..1262fa0e36a8b72a385ee0bb87f2a391784a27af 100644 (file)
@@ -63,6 +63,11 @@ class CRM_Import_Forms extends CRM_Core_Form {
    */
   protected $userJob;
 
+  /**
+   * @var \CRM_Import_Parser
+   */
+  protected $parser;
+
   /**
    * Get User Job.
    *
index d6913e93183365e840a000d8396ba49e536e0a6d..0e91fb36c42a8bb1fa5ee1f5098fa5f479d9f580 100644 (file)
@@ -59,4 +59,16 @@ class CRM_Member_Import_Form_DataSource extends CRM_Import_Form_DataSource {
     $this->submitFileForMapping('CRM_Member_Import_Parser_Membership');
   }
 
+  /**
+   * @return \CRM_Member_Import_Parser_Membership
+   */
+  protected function getParser(): CRM_Member_Import_Parser_Membership {
+    if (!$this->parser) {
+      $this->parser = new CRM_Member_Import_Parser_Membership();
+      $this->parser->setUserJobID($this->getUserJobID());
+      $this->parser->init();
+    }
+    return $this->parser;
+  }
+
 }
index b35a37eda07d1faca9ad2c7623b921f541a7a120..069ff135ac17ee9d890e4c7170b6c3f255f58602 100644 (file)
@@ -459,4 +459,16 @@ class CRM_Member_Import_Form_MapField extends CRM_Import_Form_MapField {
     $parser->set($this);
   }
 
+  /**
+   * @return \CRM_Member_Import_Parser_Membership
+   */
+  protected function getParser(): CRM_Member_Import_Parser_Membership {
+    if (!$this->parser) {
+      $this->parser = new CRM_Member_Import_Parser_Membership();
+      $this->parser->setUserJobID($this->getUserJobID());
+      $this->parser->init();
+    }
+    return $this->parser;
+  }
+
 }
index e1226987d45eb1587f62562733f89ef82e52dd84..3160ae25681ca38dc62ba105da39574f579676e9 100644 (file)
@@ -148,4 +148,16 @@ class CRM_Member_Import_Form_Preview extends CRM_Import_Form_Preview {
     }
   }
 
+  /**
+   * @return \CRM_Member_Import_Parser_Membership
+   */
+  protected function getParser(): CRM_Member_Import_Parser_Membership {
+    if (!$this->parser) {
+      $this->parser = new CRM_Member_Import_Parser_Membership();
+      $this->parser->setUserJobID($this->getUserJobID());
+      $this->parser->init();
+    }
+    return $this->parser;
+  }
+
 }