+ /**
+ * Temporary handling for phasing out contribution_invoice_settings.
+ *
+ * Until we have transitioned we need to handle setting & retrieving
+ * contribution_invoice_settings.
+ *
+ * Once removed from core we will add deprecation notices & then remove this.
+ *
+ * https://lab.civicrm.org/dev/core/issues/1558
+ *
+ * @param array $value
+ */
+ public function setContributionSettings($value) {
+ foreach (SettingsBag::getContributionInvoiceSettingKeys() as $possibleKeyName => $settingName) {
+ $keyValue = $value[$possibleKeyName] ?? '';
+ $this->set($settingName, $keyValue);
+ }
+ $this->values['contribution_invoice_settings'] = $this->getContributionSettings();
+ }
+
+ /**
+ * Temporary function to handle returning the contribution_settings key despite it being deprecated.
+ *
+ * See more in comment block on previous function.
+ *
+ * @return array
+ */
+ public function getContributionSettings() {
+ $contributionSettings = [];
+ foreach (SettingsBag::getContributionInvoiceSettingKeys() as $keyName => $settingName) {
+ $contributionSettings[$keyName] = $this->values[$settingName] ?? '';
+ }
+ return $contributionSettings;
+ }
+