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 12, 2020
1 parent 2545210 commit 2bd7e0a
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 26 deletions.
2 changes: 1 addition & 1 deletion CRM/Admin/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class CRM_Admin_Form extends CRM_Core_Form {
*
* @var int
*/
protected $_id;
public $_id;

/**
* The default values for form fields.
Expand Down
2 changes: 1 addition & 1 deletion CRM/Admin/Form/Job.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* Class for configuring jobs.
*/
class CRM_Admin_Form_Job extends CRM_Admin_Form {
protected $_id = NULL;
public $_id = NULL;

public function preProcess() {

Expand Down
2 changes: 1 addition & 1 deletion CRM/Admin/Form/LabelFormats.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CRM_Admin_Form_LabelFormats extends CRM_Admin_Form {
* Label Format ID.
* @var int
*/
protected $_id = NULL;
public $_id = NULL;

/**
* Group name, label format or name badge
Expand Down
2 changes: 1 addition & 1 deletion CRM/Admin/Form/PaymentProcessorType.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* This class generates form components for Location Type.
*/
class CRM_Admin_Form_PaymentProcessorType extends CRM_Admin_Form {
protected $_id = NULL;
public $_id = NULL;

protected $_fields = NULL;

Expand Down
2 changes: 1 addition & 1 deletion CRM/Admin/Form/PdfFormats.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CRM_Admin_Form_PdfFormats extends CRM_Admin_Form {
* PDF Page Format ID.
* @var int
*/
protected $_id = NULL;
public $_id = NULL;

/**
* Build the form object.
Expand Down
2 changes: 1 addition & 1 deletion CRM/Admin/Form/ScheduleReminders.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class CRM_Admin_Form_ScheduleReminders extends CRM_Admin_Form {
* Scheduled Reminder ID.
* @var int
*/
protected $_id = NULL;
public $_id = NULL;

public $_freqUnits;

Expand Down
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.
*
* @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
7 changes: 0 additions & 7 deletions CRM/UF/Form/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,6 @@ public function getDefaultEntity() {
return 'UFGroup';
}

/**
* The form id saved to the session for an update.
*
* @var int
*/
protected $_id;

/**
* The title for group.
*
Expand Down

0 comments on commit 2bd7e0a

Please sign in to comment.