Skip to content

Commit

Permalink
Add setEntityId() to entityForm
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwire committed Feb 10, 2020
1 parent e9ada0a commit e9f6567
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
7 changes: 0 additions & 7 deletions CRM/Contribute/Form/AbstractEditPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,6 @@ class CRM_Contribute_Form_AbstractEditPayment extends CRM_Contact_Form_Task {
*/
protected $_paymentObject;

/**
* The id of the contribution that we are processing.
*
* @var int
*/
public $_id;

/**
* Entity that $this->_id relates to.
*
Expand Down
16 changes: 16 additions & 0 deletions CRM/Core/Form/EntityFormTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
*/
trait CRM_Core_Form_EntityFormTrait {

/**
* The id of the object being edited / created. This should be protected but on some forms it was previously public
*
* @var int
*/
public $_id;

/**
* The entity subtype ID (eg. for Relationship / Activity)
*
Expand Down Expand Up @@ -71,6 +78,15 @@ public function getEntityId() {
return $this->_id;
}

/**
* Set the entity ID
*
* @param int $id The entity ID
*/
public function setEntityId($id) {
$this->_id = $id;
}

/**
* Should custom data be suppressed on this form.
*
Expand Down
6 changes: 0 additions & 6 deletions CRM/Member/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@
class CRM_Member_Form extends CRM_Contribute_Form_AbstractEditPayment {

use CRM_Core_Form_EntityFormTrait;
/**
* The id of the object being edited / created
*
* @var int
*/
public $_id;

/**
* Membership Type ID
Expand Down
2 changes: 1 addition & 1 deletion CRM/Member/Form/MembershipConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class CRM_Member_Form_MembershipConfig extends CRM_Core_Form {
*
* @var int
*/
public $_id;
protected $_id;

/**
* The name of the BAO object for this form.
Expand Down

0 comments on commit e9f6567

Please sign in to comment.