Use PascalCase with CRM_Core_Form::addEntityRef
authorColeman Watts <coleman@civicrm.org>
Mon, 18 Feb 2019 03:55:21 +0000 (22:55 -0500)
committerColeman Watts <coleman@civicrm.org>
Mon, 18 Feb 2019 03:55:21 +0000 (22:55 -0500)
Although entityRef fields accept either snake_case or CamelCase, let's be consistent.

12 files changed:
CRM/Campaign/BAO/Campaign.php
CRM/Campaign/Form/Petition.php
CRM/Campaign/Form/Survey/Main.php
CRM/Case/Form/AddToCaseAsRole.php
CRM/Core/BAO/CustomField.php
CRM/Core/Form/Tag.php
CRM/Event/BAO/Query.php
CRM/Event/Form/ManageEvent/Conference.php
CRM/Event/Form/Participant.php
CRM/Report/Form/Event/ParticipantListCount.php
CRM/Report/Form/Event/ParticipantListing.php
settings/Multisite.setting.php

index 9f6416dff196ec59d05ea0e11a0898c48406d4dc..77440fa746e100df3def57bb2f59905ea3dd517f 100644 (file)
@@ -599,7 +599,7 @@ INNER JOIN  civicrm_group grp ON ( grp.id = campgrp.entity_id )
     if ($connectedCampaignId || ($isCampaignEnabled && $hasAccessCampaign)) {
       $showAddCampaign = TRUE;
       $campaign = $form->addEntityRef('campaign_id', ts('Campaign'), [
-        'entity' => 'campaign',
+        'entity' => 'Campaign',
         'create' => TRUE,
         'select' => ['minimumInputLength' => 0],
       ]);
index d04659c297f98344a545aa943da420bbc7d74895..e1e005eda01fc2b4b6e4e3d58bae0c6a5322822c 100644 (file)
@@ -191,7 +191,7 @@ class CRM_Campaign_Form_Petition extends CRM_Core_Form {
     $this->add('wysiwyg', 'instructions', ts('Introduction'), $attributes['instructions']);
 
     $this->addEntityRef('campaign_id', ts('Campaign'), [
-      'entity' => 'campaign',
+      'entity' => 'Campaign',
       'create' => TRUE,
       'select' => ['minimumInputLength' => 0],
     ]);
index 2ef5899ad9f08b2dd0de09cc24b4b24c476a35d2..901981ab07daf975066349c8936b87f82e7276fa 100644 (file)
@@ -130,7 +130,7 @@ class CRM_Campaign_Form_Survey_Main extends CRM_Campaign_Form_Survey {
     $this->addSelect('activity_type_id', array('option_url' => 'civicrm/admin/campaign/surveyType'), TRUE);
 
     $this->addEntityRef('campaign_id', ts('Campaign'), [
-      'entity' => 'campaign',
+      'entity' => 'Campaign',
       'create' => TRUE,
       'select' => ['minimumInputLength' => 0],
     ]);
index d62dd92ad12609d983f84efe5626afb7c061e506..af02512fdd4044ed2b0452db89dd42d69e25fa00 100644 (file)
@@ -23,7 +23,7 @@ class CRM_Case_Form_AddToCaseAsRole extends CRM_Contact_Form_Task {
     $this->addEntityRef(
       'assign_to',
       ts('Assign to'),
-      array('entity' => 'case'),
+      array('entity' => 'Case'),
       TRUE
     );
 
index 8e08547b326f7eda789fed26ce63adc2d9c1185d..988cbdb67ac54f3a5b2c190527a3f78730374c11 100644 (file)
@@ -1093,7 +1093,7 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField {
         else {
           // FIXME: This won't work with customFieldOptions hook
           $attributes += array(
-            'entity' => 'option_value',
+            'entity' => 'OptionValue',
             'placeholder' => $placeholder,
             'multiple' => $search,
             'api' => array(
index 0ff005ca959641d8a2dc1718210c412b20271c41..b47d0779ca4d2b9241eb7a685a47520002711a9a 100644 (file)
@@ -78,7 +78,7 @@ class CRM_Core_Form_Tag {
         $tagset[$tagsetItem]['tagsetElementName'] = $tagsetElementName;
 
         $form->addEntityRef("{$tagsetElementName}[{$parentId}]", $parentNameItem, array(
-          'entity' => 'tag',
+          'entity' => 'Tag',
           'multiple' => TRUE,
           'create' => !$skipTagCreate,
           'api' => array('params' => array('parent_id' => $parentId)),
index 1c5c9a0ecf5abc07cdbc7f453878079311549967..e43e38377cfe8e195aae2765216e65194603144f 100644 (file)
@@ -581,14 +581,14 @@ class CRM_Event_BAO_Query extends CRM_Core_BAO_Query {
     $form->assign('dataURLEventFee', $dataURLEventFee);
 
     $form->addEntityRef('event_id', ts('Event Name'), array(
-        'entity' => 'event',
+        'entity' => 'Event',
         'placeholder' => ts('- any -'),
         'multiple' => 1,
         'select' => array('minimumInputLength' => 0),
       )
     );
     $form->addEntityRef('event_type_id', ts('Event Type'), array(
-        'entity' => 'option_value',
+        'entity' => 'OptionValue',
         'placeholder' => ts('- any -'),
         'select' => array('minimumInputLength' => 0),
         'api' => array(
index cf6eee93c0d67d6d98da28ed2b0809e1e0f5981a..cd4b3e67e610aa72f69ca6f3d102bd37a222a821 100644 (file)
@@ -57,7 +57,7 @@ class CRM_Event_Form_ManageEvent_Conference extends CRM_Event_Form_ManageEvent {
     );
 
     $this->addEntityRef('parent_event_id', ts('Parent Event'), array(
-        'entity' => 'event',
+        'entity' => 'Event',
         'placeholder' => ts('- any -'),
         'select' => array('minimumInputLength' => 0),
       )
index fdb9cacd845afaa6d50c377ba35221856404283b..ee2621e60123ae35b587a2cb452c90f32a92d8a6 100644 (file)
@@ -635,7 +635,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
     }
 
     $eventFieldParams = array(
-      'entity' => 'event',
+      'entity' => 'Event',
       'select' => array('minimumInputLength' => 0),
       'api' => array(
         'extra' => array('campaign_id', 'default_role_id', 'event_type_id'),
index 1bae9c1341a181640e2e3587a4b37360e5915fdf..2642f1abcc6cf0266f7a5e118e824417817e1cce 100644 (file)
@@ -238,7 +238,7 @@ class CRM_Report_Form_Event_ParticipantListCount extends CRM_Report_Form_Event {
             'operatorType' => CRM_Report_Form::OP_ENTITYREF,
             'type' => CRM_Utils_Type::T_INT,
             'attributes' => array(
-              'entity' => 'event',
+              'entity' => 'Event',
               'select' => array('minimumInputLength' => 0),
             ),
           ),
index 33a7a17329f2e62b8db2186fccd5003385ff3aa9..7af206a7ffc64f16b2cf9ba7905ebe49c225dda5 100644 (file)
@@ -180,7 +180,7 @@ class CRM_Report_Form_Event_ParticipantListing extends CRM_Report_Form_Event {
             'operatorType' => CRM_Report_Form::OP_ENTITYREF,
             'type' => CRM_Utils_Type::T_INT,
             'attributes' => array(
-              'entity' => 'event',
+              'entity' => 'Event',
               'select' => array('minimumInputLength' => 0),
             ),
           ),
index 7325a95b1808063214cce9c4f8f1bce83491d4a5..6f4770bba19905c848315efa3248b78f7d196674 100644 (file)
@@ -58,7 +58,7 @@ return array(
     'title' => ts('Multisite Domain Group'),
     'type' => 'Integer',
     'html_type' => 'entity_reference',
-    'entity_reference_options' => ['entity' => 'group', 'select' => array('minimumInputLength' => 0)],
+    'entity_reference_options' => ['entity' => 'Group', 'select' => array('minimumInputLength' => 0)],
     'default' => '0',
     'add' => '4.1',
     'is_domain' => 1,