Components - Use extracted function
[civicrm-core.git] / CRM / Event / BAO / Event.php
index 6a3fbdfa851f6e4759caf5ed437657a0d1703f5d..20534481a0cd726567dbf5732a11899273fc31d7 100644 (file)
@@ -24,7 +24,7 @@ class CRM_Event_BAO_Event extends CRM_Event_DAO_Event {
    * @param array $defaults
    *   (reference ) an assoc array to hold the flattened values.
    *
-   * @return CRM_Event_DAO_Event
+   * @return CRM_Event_DAO_Event|null
    */
   public static function retrieve(&$params, &$defaults) {
     $event = new CRM_Event_DAO_Event();
@@ -2357,7 +2357,7 @@ LEFT  JOIN  civicrm_price_field_value value ON ( value.id = lineItem.price_field
         // @todo - the component is enabled check should be done within getIncomeFinancialType
         // It looks to me like test cover was NOT added to cover the change
         // that added this so we need to assume there is no test cover
-        if (array_key_exists('CiviContribute', CRM_Core_Component::getEnabledComponents())) {
+        if (CRM_Core_Component::isEnabled('CiviContribute')) {
           return CRM_Financial_BAO_FinancialType::getIncomeFinancialType($props['check_permissions'] ?? TRUE);
         }
         return [];