/**
* This class provides support for canceling recurring subscriptions.
*/
-class CRM_Contribute_Form_CancelSubscription extends CRM_Core_Form {
+class CRM_Contribute_Form_CancelSubscription extends CRM_Contribute_Form_ContributionRecur {
protected $_paymentProcessorObj = NULL;
protected $_userContext = NULL;
protected $_mid = NULL;
- protected $_coid = NULL;
-
- protected $_crid = NULL;
-
protected $_selfService = FALSE;
/**
--- /dev/null
+<?php
+/*
+ +--------------------------------------------------------------------+
+ | CiviCRM version 5 |
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC (c) 2004-2019 |
+ +--------------------------------------------------------------------+
+ | This file is a part of CiviCRM. |
+ | |
+ | CiviCRM is free software; you can copy, modify, and distribute it |
+ | under the terms of the GNU Affero General Public License |
+ | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
+ | |
+ | CiviCRM is distributed in the hope that it will be usefusul, but |
+ | WITHOUT ANY WARRANTY; without even the implied warranty of |
+ | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
+ | See the GNU Affero General Public License for more details. |
+ | |
+ | You should have received a copy of the GNU Affero General Public |
+ | License and the CiviCRM Licensing Exception along |
+ | with this program; if not, contact CiviCRM LLC |
+ | at info[AT]civicrm[DOT]org. If you have questions about the |
+ | GNU Affero General Public License or the licensing of CiviCRM, |
+ | see the CiviCRM license FAQ at http://civicrm.org/licensing |
+ +--------------------------------------------------------------------+
+ */
+
+/**
+ *
+ * @package CRM
+ * @copyright CiviCRM LLC (c) 2004-2019
+ */
+
+/**
+ * Shared parent class for recurring contribution forms.
+ */
+class CRM_Contribute_Form_ContributionRecur extends CRM_Core_Form {
+
+ /**
+ * @var int Contribution ID
+ */
+ protected $_coid = NULL;
+
+ /**
+ * @var int Contribution Recur ID
+ */
+ protected $_crid = NULL;
+
+ /**
+ * Explicitly declare the entity api name.
+ */
+ public function getDefaultEntity() {
+ return 'ContributionRecur';
+ }
+
+ /**
+ * Explicitly declare the form context.
+ */
+ public function getDefaultContext() {
+ return 'create';
+ }
+
+}
* back in. It also uses a lot of functionality with the CRM API's, so any change
* made here could potentially affect the API etc. Be careful, be aware, use unit tests.
*/
-class CRM_Contribute_Form_UpdateSubscription extends CRM_Core_Form {
+class CRM_Contribute_Form_UpdateSubscription extends CRM_Contribute_Form_ContributionRecur {
/**
* The recurring contribution id, used when editing the recurring contribution.
*/
protected $contributionRecurID = NULL;
- protected $_coid = NULL;
-
protected $_subscriptionDetails = NULL;
protected $_selfService = FALSE;
}
}
- /**
- * Explicitly declare the form context.
- */
- public function getDefaultContext() {
- return 'create';
- }
-
}