Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REF][PHP8.2] Declare properties directly on CRM_Core_Form_EntityFormTrait #25926

Merged
merged 1 commit into from
Mar 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions CRM/Admin/Form/PaymentProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,6 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form {
*/
protected $_paymentProcessorType;

/**
* Fields for the entity to be assigned to the template.
*
* Fields may have keys
* - name (required to show in tpl from the array)
* - description (optional, will appear below the field)
* Auto-added by setEntityFieldsMetadata unless specified here (use description => '' to hide)
* - not-auto-addable - this class will not attempt to add the field using addField.
* (this will be automatically set if the field does not have html in it's metadata
* or is not a core field on the form's entity).
* - help (option) add help to the field - e.g ['id' => 'id-source', 'file' => 'CRM/Contact/Form/Contact']]
* - template - use a field specific template to render this field
* - required
* - is_freeze (field should be frozen).
*
* @var array
*/
protected $entityFields = [];

/**
* Set entity fields to be assigned to the form.
*/
Expand Down
19 changes: 0 additions & 19 deletions CRM/Admin/Form/RelationshipType.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,6 @@ class CRM_Admin_Form_RelationshipType extends CRM_Admin_Form {

protected $_BAOName = 'CRM_Contact_BAO_RelationshipType';

/**
* Fields for the entity to be assigned to the template.
*
* Fields may have keys
* - name (required to show in tpl from the array)
* - description (optional, will appear below the field)
* Auto-added by setEntityFieldsMetadata unless specified here (use description => '' to hide)
* - not-auto-addable - this class will not attempt to add the field using addField.
* (this will be automatically set if the field does not have html in it's metadata
* or is not a core field on the form's entity).
* - help (option) add help to the field - e.g ['id' => 'id-source', 'file' => 'CRM/Contact/Form/Contact']]
* - template - use a field specific template to render this field
* - required
* - is_freeze (field should be frozen).
*
* @var array
*/
protected $entityFields = [];

/**
* Set entity fields to be assigned to the form.
*/
Expand Down
15 changes: 0 additions & 15 deletions CRM/Contribute/Form/ContributionRecur.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,6 @@ class CRM_Contribute_Form_ContributionRecur extends CRM_Core_Form {
*/
public $_paymentProcessor = [];

/**
* Fields for the entity to be assigned to the template.
*
* Fields may have keys
* - name (required to show in tpl from the array)
* - description (optional, will appear below the field)
* - not-auto-addable - this class will not attempt to add the field using addField.
* (this will be automatically set if the field does not have html in it's metadata
* or is not a core field on the form's entity).
* - help (option) add help to the field - e.g ['id' => 'id-source', 'file' => 'CRM/Contact/Form/Contact']]
* - template - use a field specific template to render this field
* @var array
*/
protected $entityFields = [];

/**
* Details of the subscription (recurring contribution) to be altered.
*
Expand Down
25 changes: 25 additions & 0 deletions CRM/Core/Form/EntityFormTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,31 @@ trait CRM_Core_Form_EntityFormTrait {
*/
protected $deleteMessage;

/**
* Fields for the entity to be assigned to the template.
*
* Fields may have keys
* - name (required to show in tpl from the array)
* - description (optional, will appear below the field)
* - not-auto-addable - this class will not attempt to add the field using addField.
* (this will be automatically set if the field does not have html in it's metadata
* or is not a core field on the form's entity).
* - help (option) add help to the field - e.g ['id' => 'id-source', 'file' => 'CRM/Contact/Form/Contact']]
* - template - use a field specific template to render this field
* - required
* - is_freeze (field should be frozen).
*
* @var array
*/
protected $entityFields = [];

/**
* Metadata from getfields API call for the current entity.
*
* @var array
*/
protected $metadata = [];

/**
* Get entity fields for the entity to be added to the form.
*
Expand Down
7 changes: 0 additions & 7 deletions CRM/Financial/Form/FinancialType.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ class CRM_Financial_Form_FinancialType extends CRM_Core_Form {

protected $_BAOName = 'CRM_Financial_BAO_FinancialType';

/**
* Fields for the entity to be assigned to the template.
*
* @var array
*/
protected $entityFields = [];

/**
* Set variables up before form is built.
*
Expand Down
18 changes: 0 additions & 18 deletions CRM/Member/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,24 +121,6 @@ protected function getStatusMessage() {
*/
protected $_params = [];

/**
* Fields for the entity to be assigned to the template.
*
* Fields may have keys
* - name (required to show in tpl from the array)
* - description (optional, will appear below the field)
* - not-auto-addable - this class will not attempt to add the field using addField.
* (this will be automatically set if the field does not have html in it's metadata
* or is not a core field on the form's entity).
* - help (option) add help to the field - e.g ['id' => 'id-source', 'file' => 'CRM/Contact/Form/Contact']]
* - template - use a field specific template to render this field
* - required
* - is_freeze (field should be frozen).
*
* @var array
*/
protected $entityFields = [];

public function preProcess() {
// Check for edit permission.
if (!CRM_Core_Permission::checkActionPermission('CiviMember', $this->_action)) {
Expand Down
16 changes: 0 additions & 16 deletions CRM/Member/Form/MembershipStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,6 @@ public function getDefaultContext() {
return 'create';
}

/**
* Fields for the entity to be assigned to the template.
*
* Fields may have keys
* - name (required to show in tpl from the array)
* - description (optional, will appear below the field)
* - not-auto-addable - this class will not attempt to add the field using addField.
* (this will be automatically set if the field does not have html in it's metadata
* or is not a core field on the form's entity).
* - help (optional) add help to the field - e.g ['id' => 'id-source', 'file' => 'CRM/Contact/Form/Contact']]
* - template - use a field specific template to render this field
* - required
* @var array
*/
protected $entityFields = [];

/**
* Set entity fields to be assigned to the form.
*/
Expand Down
18 changes: 0 additions & 18 deletions CRM/Member/Form/MembershipType.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,6 @@ class CRM_Member_Form_MembershipType extends CRM_Member_Form_MembershipConfig {

use CRM_Core_Form_EntityFormTrait;

/**
* Fields for the entity to be assigned to the template.
*
* Fields may have keys
* - name (required to show in tpl from the array)
* - description (optional, will appear below the field)
* - not-auto-addable - this class will not attempt to add the field using addField.
* (this will be automatically set if the field does not have html in it's metadata
* or is not a core field on the form's entity).
* - help (option) add help to the field - e.g ['id' => 'id-source', 'file' => 'CRM/Contact/Form/Contact']]
* - template - use a field specific template to render this field
* - required
* - is_freeze (field should be frozen).
*
* @var array
*/
protected $entityFields = [];

/**
* Set entity fields to be assigned to the form.
*/
Expand Down
15 changes: 0 additions & 15 deletions CRM/Price/Form/Set.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,6 @@ public function getDefaultEntity() {
return 'PriceSet';
}

/**
* Fields for the entity to be assigned to the template.
*
* Fields may have keys
* - name (required to show in tpl from the array)
* - description (optional, will appear below the field)
* - not-auto-addable - this class will not attempt to add the field using addField.
* (this will be automatically set if the field does not have html in it's metadata
* or is not a core field on the form's entity).
* - help (option) add help to the field - e.g ['id' => 'id-source', 'file' => 'CRM/Contact/Form/Contact']]
* - template - use a field specific template to render this field
* @var array
*/
protected $entityFields = [];

/**
* Set entity fields to be assigned to the form.
*/
Expand Down
18 changes: 0 additions & 18 deletions CRM/UF/Form/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,6 @@ class CRM_UF_Form_Group extends CRM_Core_Form {

use CRM_Core_Form_EntityFormTrait;

/**
* Fields for the entity to be assigned to the template.
*
* Fields may have keys
* - name (required to show in tpl from the array)
* - description (optional, will appear below the field)
* - not-auto-addable - this class will not attempt to add the field using addField.
* (this will be automatically set if the field does not have html in it's metadata
* or is not a core field on the form's entity).
* - help (option) add help to the field - e.g ['id' => 'id-source', 'file' => 'CRM/Contact/Form/Contact']]
* - template - use a field specific template to render this field
* - required
* - is_freeze (field should be frozen).
*
* @var array
*/
protected $entityFields = [];

/**
* @var bool
*/
Expand Down