Merge pull request #4693 from jaapjansma/CRM-15702
[civicrm-core.git] / CRM / Upgrade / Incremental / php / FourThree.php
index 42c9a5cf380d459265e095f14c1121a3aa2a1012..30daff27d2011d51fec20fee885f3dbe724d39f5 100644 (file)
 class CRM_Upgrade_Incremental_php_FourThree {
   const BATCH_SIZE = 5000;
 
+  /**
+   * @param $errors
+   *
+   * @return bool
+   */
   function verifyPreDBstate(&$errors) {
     return TRUE;
   }
@@ -49,7 +54,6 @@ class CRM_Upgrade_Incremental_php_FourThree {
    * @param $rev string, a version number, e.g. '4.3.alpha1', '4.3.beta3', '4.3.0'
    * @param null $currentVer
    *
-   * @internal param string $postUpgradeMessage , alterable
    * @return void|bool
    */
   function setPreUpgradeMessage(&$preUpgradeMessage, $rev, $currentVer = NULL) {
@@ -236,6 +240,11 @@ WHERE ccp.financial_type_id IS NULL and cp.cost > 0');
     }
   }
 
+  /**
+   * @param $rev
+   *
+   * @return bool
+   */
   function upgrade_4_3_alpha1($rev) {
     self::task_4_3_alpha1_checkDBConstraints();
 
@@ -271,6 +280,9 @@ WHERE ccp.financial_type_id IS NULL and cp.cost > 0');
     return TRUE;
   }
 
+  /**
+   * @param $rev
+   */
   function upgrade_4_3_alpha2($rev) {
     //CRM-11847
     $isColumnPresent = CRM_Core_DAO::checkFieldExists('civicrm_dedupe_rule_group', 'is_default');
@@ -280,10 +292,16 @@ WHERE ccp.financial_type_id IS NULL and cp.cost > 0');
     $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.alpha2')), 'task_4_3_x_runSql', $rev);
   }
 
+  /**
+   * @param $rev
+   */
   function upgrade_4_3_alpha3($rev) {
     $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.alpha3')), 'task_4_3_x_runSql', $rev);
   }
 
+  /**
+   * @param $rev
+   */
   function upgrade_4_3_beta2($rev) {
     $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.beta2')), 'task_4_3_x_runSql', $rev);
 
@@ -296,6 +314,9 @@ WHERE ccp.financial_type_id IS NULL and cp.cost > 0');
     }
   }
 
+  /**
+   * @param $rev
+   */
   function upgrade_4_3_beta3($rev) {
     $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.beta3')), 'task_4_3_x_runSql', $rev);
     // CRM-12065
@@ -305,6 +326,9 @@ WHERE ccp.financial_type_id IS NULL and cp.cost > 0');
     $this->addTask('Replace contribution_type to financial_type in table civicrm_saved_search', 'replaceContributionTypeId', $query, 'savedSearch');
   }
 
+  /**
+   * @param $rev
+   */
   function upgrade_4_3_beta4($rev) {
     $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.beta4')), 'task_4_3_x_runSql', $rev);
     // add indexes for civicrm_entity_financial_trxn
@@ -312,6 +336,9 @@ WHERE ccp.financial_type_id IS NULL and cp.cost > 0');
     $this->addTask('Check/Add indexes for civicrm_entity_financial_trxn', 'task_4_3_x_checkIndexes', $rev);
   }
 
+  /**
+   * @param $rev
+   */
   function upgrade_4_3_beta5($rev) {
     // CRM-12205
     if (
@@ -336,10 +363,16 @@ ADD COLUMN   premiums_nothankyou_label varchar(255) COLLATE utf8_unicode_ci DEFA
     $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.beta5')), 'task_4_3_x_runSql', $rev);
   }
 
+  /**
+   * @param $rev
+   */
   function upgrade_4_3_4($rev) {
     $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.4')), 'task_4_3_x_runSql', $rev);
   }
 
+  /**
+   * @param $rev
+   */
   function upgrade_4_3_5($rev) {
     // CRM-12156
     $config = CRM_Core_Config::singleton();
@@ -365,6 +398,9 @@ ADD CONSTRAINT `FK_civicrm_financial_item_contact_id` FOREIGN KEY (`contact_id`)
     $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.5')), 'task_4_3_x_runSql', $rev);
   }
 
+  /**
+   * @param $rev
+   */
   function upgrade_4_3_6($rev) {
     //CRM-13094
     $this->addTask(ts('Add missing constraints'), 'addMissingConstraints', $rev);
@@ -378,6 +414,9 @@ ADD CONSTRAINT `FK_civicrm_financial_item_contact_id` FOREIGN KEY (`contact_id`)
   }
 
   //CRM-11636
+  /**
+   * @return bool
+   */
   function assignFinancialTypeToPriceRecords() {
     $upgrade = new CRM_Upgrade_Form();
     //here we update price set entries
@@ -419,6 +458,9 @@ INNER JOIN civicrm_price_set ps ON (pf.price_set_id = ps.id)
     return TRUE;
   }
 
+  /**
+   * @return bool
+   */
   static function _checkAndMigrateDefaultFinancialTypes() {
     $modifiedDefaults = FALSE;
     //insert types if not exists
@@ -448,6 +490,9 @@ ON DUPLICATE KEY UPDATE  is_active = 1
     return $modifiedDefaults;
   }
 
+  /**
+   * @return bool
+   */
   function createFinancialRecords() {
     $upgrade = new CRM_Upgrade_Form();
 
@@ -789,6 +834,9 @@ FROM   civicrm_financial_item fi";
     return TRUE;
   }
 
+  /**
+   * @return array
+   */
   function createDomainContacts() {
     $domainParams = $context = array();
     $query = "
@@ -917,7 +965,7 @@ ALTER TABLE civicrm_financial_account
   }
 
   /**
-   * change index and add missing constraints for civicrm_contribution_recur
+   * Change index and add missing constraints for civicrm_contribution_recur
    */
   function addMissingConstraints(CRM_Queue_TaskContext $ctx) {
     $query = "SHOW KEYS FROM `civicrm_contribution_recur` WHERE key_name = 'UI_contrib_payment_instrument_id'";
@@ -1074,7 +1122,7 @@ AND cli.entity_table = 'civicrm_contribution' AND cli.id IN (" . implode(',', $v
   }
 
   /**
-   * replace contribution_type to financial_type in table
+   * Replace contribution_type to financial_type in table
    * civicrm_saved_search and Structure civicrm_report_instance
    */
   function replaceContributionTypeId(CRM_Queue_TaskContext $ctx, $query, $table) {