diff --git a/CRM/Activity/Import/Form/DataSource.php b/CRM/Activity/Import/Form/DataSource.php index a244cb7e0a86..45838871d920 100644 --- a/CRM/Activity/Import/Form/DataSource.php +++ b/CRM/Activity/Import/Form/DataSource.php @@ -56,4 +56,16 @@ public function postProcess() { $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; + } + } diff --git a/CRM/Activity/Import/Form/MapField.php b/CRM/Activity/Import/Form/MapField.php index 8008bc0412c4..2dc0f5ce5d62 100644 --- a/CRM/Activity/Import/Form/MapField.php +++ b/CRM/Activity/Import/Form/MapField.php @@ -395,4 +395,16 @@ public function postProcess() { $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; + } + } diff --git a/CRM/Activity/Import/Form/Preview.php b/CRM/Activity/Import/Form/Preview.php index 09e5bf2791c2..f26d7f67f6f7 100644 --- a/CRM/Activity/Import/Form/Preview.php +++ b/CRM/Activity/Import/Form/Preview.php @@ -126,4 +126,16 @@ public function postProcess() { } } + /** + * @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; + } + } diff --git a/CRM/Contribute/Import/Form/DataSource.php b/CRM/Contribute/Import/Form/DataSource.php index 37c0191d5ef2..1a6c307fac9d 100644 --- a/CRM/Contribute/Import/Form/DataSource.php +++ b/CRM/Contribute/Import/Form/DataSource.php @@ -59,4 +59,16 @@ public function postProcess() { $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; + } + } diff --git a/CRM/Contribute/Import/Form/MapField.php b/CRM/Contribute/Import/Form/MapField.php index 34567d0874b4..92cf33ebc59d 100644 --- a/CRM/Contribute/Import/Form/MapField.php +++ b/CRM/Contribute/Import/Form/MapField.php @@ -496,9 +496,12 @@ public function postProcess() { * @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; } } diff --git a/CRM/Contribute/Import/Form/Preview.php b/CRM/Contribute/Import/Form/Preview.php index 97b645088189..4bb5a55b4c41 100644 --- a/CRM/Contribute/Import/Form/Preview.php +++ b/CRM/Contribute/Import/Form/Preview.php @@ -139,4 +139,16 @@ public function postProcess() { } } + /** + * @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; + } + } diff --git a/CRM/Custom/Import/Form/DataSource.php b/CRM/Custom/Import/Form/DataSource.php index 92514fc07bde..71b2eb52b96d 100644 --- a/CRM/Custom/Import/Form/DataSource.php +++ b/CRM/Custom/Import/Form/DataSource.php @@ -96,4 +96,16 @@ public function postProcess() { $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; + } + } diff --git a/CRM/Custom/Import/Form/Preview.php b/CRM/Custom/Import/Form/Preview.php index 6bee78ad9f2e..a9a01a528fe7 100644 --- a/CRM/Custom/Import/Form/Preview.php +++ b/CRM/Custom/Import/Form/Preview.php @@ -115,4 +115,16 @@ public function postProcess() { } } + /** + * @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; + } + } diff --git a/CRM/Event/Import/Form/DataSource.php b/CRM/Event/Import/Form/DataSource.php index c97c9d7fdbe9..93f881290994 100644 --- a/CRM/Event/Import/Form/DataSource.php +++ b/CRM/Event/Import/Form/DataSource.php @@ -59,4 +59,16 @@ public function postProcess() { $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; + } + } diff --git a/CRM/Event/Import/Form/MapField.php b/CRM/Event/Import/Form/MapField.php index c4907fd2a6ee..33228af04511 100644 --- a/CRM/Event/Import/Form/MapField.php +++ b/CRM/Event/Import/Form/MapField.php @@ -430,4 +430,16 @@ public function postProcess() { $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; + } + } diff --git a/CRM/Event/Import/Form/Preview.php b/CRM/Event/Import/Form/Preview.php index b5e0320d1ff5..7456aee9200a 100644 --- a/CRM/Event/Import/Form/Preview.php +++ b/CRM/Event/Import/Form/Preview.php @@ -128,4 +128,16 @@ public function postProcess() { } } + /** + * @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; + } + } diff --git a/CRM/Import/Forms.php b/CRM/Import/Forms.php index e752dc6c8304..1262fa0e36a8 100644 --- a/CRM/Import/Forms.php +++ b/CRM/Import/Forms.php @@ -63,6 +63,11 @@ public function setUserJobID(int $userJobID): void { */ protected $userJob; + /** + * @var \CRM_Import_Parser + */ + protected $parser; + /** * Get User Job. * diff --git a/CRM/Member/Import/Form/DataSource.php b/CRM/Member/Import/Form/DataSource.php index d6913e931833..0e91fb36c42a 100644 --- a/CRM/Member/Import/Form/DataSource.php +++ b/CRM/Member/Import/Form/DataSource.php @@ -59,4 +59,16 @@ public function postProcess() { $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; + } + } diff --git a/CRM/Member/Import/Form/MapField.php b/CRM/Member/Import/Form/MapField.php index b35a37eda07d..069ff135ac17 100644 --- a/CRM/Member/Import/Form/MapField.php +++ b/CRM/Member/Import/Form/MapField.php @@ -459,4 +459,16 @@ public function postProcess() { $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; + } + } diff --git a/CRM/Member/Import/Form/Preview.php b/CRM/Member/Import/Form/Preview.php index e1226987d45e..3160ae25681c 100644 --- a/CRM/Member/Import/Form/Preview.php +++ b/CRM/Member/Import/Form/Preview.php @@ -148,4 +148,16 @@ public function postProcess() { } } + /** + * @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; + } + }