(REF) GenerateData - Extract method 'generateAll()'
authorTim Otten <totten@civicrm.org>
Wed, 16 Sep 2020 07:39:14 +0000 (00:39 -0700)
committerTim Otten <totten@civicrm.org>
Wed, 16 Sep 2020 10:37:08 +0000 (03:37 -0700)
CRM/Core/CodeGen/GenerateData.php
sql/GenerateData.php

index eea39e6591d592f1c50d412e2aa0b54a46af9204..182fbd6432cdc59367323f7b933ee3f50c36d170 100644 (file)
@@ -46,7 +46,37 @@ class CRM_Core_CodeGen_GenerateData {
 
     // Relationship types indexed by name_a_b from the table civicrm_relationship_type
     $this->relTypes = CRM_Utils_Array::index(array('name_a_b'), CRM_Core_PseudoConstant::relationshipType('name'));
+  }
 
+  /**
+   * Create a full, standard set of random data.
+   */
+  public function generateAll() {
+    $this->initID();
+    $this->generate('Domain');
+    $this->generate('Contact');
+    $this->generate('Individual');
+    $this->generate('Household');
+    $this->generate('Organization');
+    $this->generate('Relationship');
+    $this->generate('EntityTag');
+    $this->generate('Group');
+    $this->generate('Note');
+    $this->generate('Activity');
+    $this->generate('Event');
+    $this->generate('Contribution');
+    $this->generate('ContributionLineItem');
+    $this->generate('Membership');
+    $this->generate('MembershipPayment');
+    $this->generate('MembershipLog');
+    $this->generate('PCP');
+    $this->generate('SoftContribution');
+    $this->generate('Pledge');
+    $this->generate('PledgePayment');
+    $this->generate('Participant');
+    $this->generate('ParticipantPayment');
+    $this->generate('LineItemParticipants');
+    $this->generate('AccountingEntries');
   }
 
   /**
index afa8de67a85a7d9a67367d5bc70be4f5eb1c5ff5..84732496f5140ae918b28351fe2228080c5e77c2 100644 (file)
@@ -78,29 +78,5 @@ CRM_Core_ClassLoader::singleton()->register();
 
 echo ("Starting data generation on " . date("F dS h:i:s A") . "\n");
 $gcd = new CRM_Core_CodeGen_GenerateData();
-$gcd->initID();
-$gcd->generate('Domain');
-$gcd->generate('Contact');
-$gcd->generate('Individual');
-$gcd->generate('Household');
-$gcd->generate('Organization');
-$gcd->generate('Relationship');
-$gcd->generate('EntityTag');
-$gcd->generate('Group');
-$gcd->generate('Note');
-$gcd->generate('Activity');
-$gcd->generate('Event');
-$gcd->generate('Contribution');
-$gcd->generate('ContributionLineItem');
-$gcd->generate('Membership');
-$gcd->generate('MembershipPayment');
-$gcd->generate('MembershipLog');
-$gcd->generate('PCP');
-$gcd->generate('SoftContribution');
-$gcd->generate('Pledge');
-$gcd->generate('PledgePayment');
-$gcd->generate('Participant');
-$gcd->generate('ParticipantPayment');
-$gcd->generate('LineItemParticipants');
-$gcd->generate('AccountingEntries');
+$gcd->generateAll();
 echo ("Ending data generation on " . date("F dS h:i:s A") . "\n");