Skip to content

Commit

Permalink
[Import] Add some not-yet-used functions that are prone to conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed May 26, 2022
1 parent d409829 commit 0012914
Show file tree
Hide file tree
Showing 15 changed files with 167 additions and 3 deletions.
12 changes: 12 additions & 0 deletions CRM/Activity/Import/Form/DataSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}
12 changes: 12 additions & 0 deletions CRM/Activity/Import/Form/MapField.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}
12 changes: 12 additions & 0 deletions CRM/Activity/Import/Form/Preview.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}
12 changes: 12 additions & 0 deletions CRM/Contribute/Import/Form/DataSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}
9 changes: 6 additions & 3 deletions CRM/Contribute/Import/Form/MapField.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}
12 changes: 12 additions & 0 deletions CRM/Contribute/Import/Form/Preview.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}
12 changes: 12 additions & 0 deletions CRM/Custom/Import/Form/DataSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}
12 changes: 12 additions & 0 deletions CRM/Custom/Import/Form/Preview.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}
12 changes: 12 additions & 0 deletions CRM/Event/Import/Form/DataSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}
12 changes: 12 additions & 0 deletions CRM/Event/Import/Form/MapField.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}
12 changes: 12 additions & 0 deletions CRM/Event/Import/Form/Preview.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}
5 changes: 5 additions & 0 deletions CRM/Import/Forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ public function setUserJobID(int $userJobID): void {
*/
protected $userJob;

/**
* @var \CRM_Import_Parser
*/
protected $parser;

/**
* Get User Job.
*
Expand Down
12 changes: 12 additions & 0 deletions CRM/Member/Import/Form/DataSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}
12 changes: 12 additions & 0 deletions CRM/Member/Import/Form/MapField.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}
12 changes: 12 additions & 0 deletions CRM/Member/Import/Form/Preview.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}

0 comments on commit 0012914

Please sign in to comment.