'id-source', 'file' => 'CRM/Contact/Form/Contact']] * - template - use a field specific template to render this field * @var array */ protected $entityFields = []; /** * Explicitly declare the entity api name. */ public function getDefaultEntity() { return 'ContributionRecur'; } /** * Explicitly declare the form context. */ public function getDefaultContext() { return 'create'; } /** * Set variables up before form is built. */ public function preProcess() { $this->setAction(CRM_Core_Action::UPDATE); $this->_mid = CRM_Utils_Request::retrieve('mid', 'Integer', $this, FALSE); $this->_crid = CRM_Utils_Request::retrieve('crid', 'Integer', $this, FALSE); $this->contributionRecurID = $this->_crid; $this->_coid = CRM_Utils_Request::retrieve('coid', 'Integer', $this, FALSE); $this->setPaymentProcessor(); } /** * Set the payment processor object up. * * This is a function that needs to be better consolidated between the inheriting forms * but this is good choice of function to call. */ protected function setPaymentProcessor() { if ($this->_crid) { $this->_paymentProcessor = CRM_Contribute_BAO_ContributionRecur::getPaymentProcessor($this->contributionRecurID); if (!$this->_paymentProcessor) { CRM_Core_Error::statusBounce(ts('There is no valid processor for this subscription so it cannot be updated')); } $this->_paymentProcessorObj = $this->_paymentProcessor['object']; } } }