[REF][PHP8.2] Declare properties directly on CRM_Core_Form_EntityFormTrait
authorBradley Taylor <hello@brad-taylor.co.uk>
Sun, 26 Mar 2023 10:52:14 +0000 (11:52 +0100)
committerBradley Taylor <hello@brad-taylor.co.uk>
Sun, 26 Mar 2023 10:52:14 +0000 (11:52 +0100)
CRM/Admin/Form/PaymentProcessor.php
CRM/Admin/Form/RelationshipType.php
CRM/Contribute/Form/ContributionRecur.php
CRM/Core/Form/EntityFormTrait.php
CRM/Financial/Form/FinancialType.php
CRM/Member/Form.php
CRM/Member/Form/MembershipStatus.php
CRM/Member/Form/MembershipType.php
CRM/Price/Form/Set.php
CRM/UF/Form/Group.php

index 1e04b954972df3b94eeeb4ddbf5f915e34eb8504..f35eda6afa4e1a85439cf2dbea37f0490bc0b9d4 100644 (file)
@@ -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.
    */
index b6c02254fe1f1133bbabc6643cfd73661e47a0ca..a44d987eb3da1b7c352bed9b5bed0b6a535ac4cf 100644 (file)
@@ -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.
    */
index ccf86182b1953dadbd83ecbb68d0397ccc605e76..7402e94cad2bf0f027d76c9daeaa39c0a650df14 100644 (file)
@@ -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.
    *
index 1a4c1beefecc42a586504d8cd897102bc42ce95e..2d09fa550ab9daa368d59bf217c5e7bd20e23a09 100644 (file)
@@ -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.
    *
index 3d9f046966ecfd39c8869eb31163ecf97f30526e..47021552532c67ab6064c72d85674da1a33b4346 100644 (file)
@@ -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.
    *
index e52bccbea90a704924378626744dacc7ec2fb3a8..b50799354ce0f6d7115828173c96059a064890da 100644 (file)
@@ -121,24 +121,6 @@ class CRM_Member_Form extends CRM_Contribute_Form_AbstractEditPayment {
    */
   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)) {
index 967e81bfd268f481d4f05e64144b72add2ffbe2c..af276795fc418f94bf542bfcb3dfe9b9b759fcf3 100644 (file)
@@ -36,22 +36,6 @@ class CRM_Member_Form_MembershipStatus extends CRM_Core_Form {
     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.
    */
index 17586c64783b4dc454097d030de94153565b620c..e8992363fc451373fac1271076c2b04a5d8fc685 100644 (file)
@@ -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.
    */
index a9c8af801745dcd5046a283b2df0603c41dadf48..9bf062edb598e392fadc2638a8408e375c3624ef 100644 (file)
@@ -45,21 +45,6 @@ class CRM_Price_Form_Set extends CRM_Core_Form {
     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.
    */
index c3cdcc4b78655df0c8d8ed852519efd74f1b63e7..881b1ceedfd42cb2dc906c610b3c4508a64ec2a5 100644 (file)
@@ -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
    */