Remove unused, duplicate functions getEntitiesByTag
authorColeman Watts <coleman@civicrm.org>
Sat, 21 Aug 2021 20:10:36 +0000 (16:10 -0400)
committerColeman Watts <coleman@civicrm.org>
Sat, 21 Aug 2021 20:10:36 +0000 (16:10 -0400)
According to https://issues.civicrm.org/jira/browse/CRM-13156
the functions were only ever used in the v2 API, which no longer exists.

CRM/Campaign/BAO/Petition.php
CRM/Core/BAO/EntityTag.php

index a13450f148500ee745cf158d881830ebb97d1353..5d3d55a5f0a94420cd07fc877251afa7e95eaabc 100644 (file)
@@ -448,27 +448,6 @@ AND         tag_id = ( SELECT id FROM civicrm_tag WHERE name = %2 )";
     return $signature;
   }
 
-  /**
-   * This function returns all entities assigned to a specific tag.
-   *
-   * @param object $tag
-   *   An object of a tag.
-   *
-   * @return array
-   *   array of contact ids
-   */
-  public function getEntitiesByTag($tag) {
-    $contactIds = [];
-    $entityTagDAO = new CRM_Core_DAO_EntityTag();
-    $entityTagDAO->tag_id = $tag['id'];
-    $entityTagDAO->find();
-
-    while ($entityTagDAO->fetch()) {
-      $contactIds[] = $entityTagDAO->entity_id;
-    }
-    return $contactIds;
-  }
-
   /**
    * Check if contact has signed this petition.
    *
index 9000ade79c99d61973e458be756ce683c66a8f45..e2a6ba032fad0ea762df53fbf42ef62c6226b49e 100644 (file)
@@ -290,26 +290,6 @@ class CRM_Core_BAO_EntityTag extends CRM_Core_DAO_EntityTag {
     }
   }
 
-  /**
-   * This function returns all entities assigned to a specific tag.
-   *
-   * @param object $tag
-   *   An object of a tag.
-   *
-   * @return array
-   *   array of entity ids
-   */
-  public function getEntitiesByTag($tag) {
-    $entityIds = [];
-    $entityTagDAO = new CRM_Core_DAO_EntityTag();
-    $entityTagDAO->tag_id = $tag->id;
-    $entityTagDAO->find();
-    while ($entityTagDAO->fetch()) {
-      $entityIds[] = $entityTagDAO->entity_id;
-    }
-    return $entityIds;
-  }
-
   /**
    * Get contact tags.
    *