Merge pull request #22241 from colemanw/searchKitFunctions
[civicrm-core.git] / CRM / Core / Reference / Dynamic.php
index c7224922abe81f7609c34c50b35a5b613fca1195..b806a89398a7feb2650cdac82c5ad0f96183c9b5 100644 (file)
@@ -24,7 +24,8 @@ class CRM_Core_Reference_Dynamic extends CRM_Core_Reference_Basic {
   public function getTargetEntities(): array {
     $targetEntities = [];
     $bao = CRM_Core_DAO_AllCoreTables::getClassForTable($this->refTable);
-    foreach ($bao::buildOptions($this->refTypeColumn) as $table => $label) {
+    $targetTables = (array) $bao::buildOptions($this->refTypeColumn);
+    foreach ($targetTables as $table => $label) {
       $targetEntities[$table] = CRM_Core_DAO_AllCoreTables::getEntityNameForTable($table);
     }
     return $targetEntities;