Merge pull request #23190 from eileenmcnaughton/pradeep
[civicrm-core.git] / CRM / Core / BAO / Tag.php
index 32c92d5b7abc8f7e8ef5abfe7edbdbf440415606..494bd8510bc07d566eb9ad55c1d24c1e09eda70a 100644 (file)
@@ -22,24 +22,20 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag {
   protected $tree;
 
   /**
-   * Fetch object based on array of properties.
+   * Retrieve DB object and copy to defaults array.
    *
    * @param array $params
-   *   (reference ) an assoc array of name/value pairs.
+   *   Array of criteria values.
    * @param array $defaults
-   *   (reference ) an assoc array to hold the flattened values.
+   *   Array to be populated with found values.
    *
-   * @return object
-   *   CRM_Core_DAO_Tag object on success, otherwise null
+   * @return self|null
+   *   The DAO object, if found.
+   *
+   * @deprecated
    */
-  public static function retrieve(&$params, &$defaults) {
-    $tag = new CRM_Core_DAO_Tag();
-    $tag->copyValues($params);
-    if ($tag->find(TRUE)) {
-      CRM_Core_DAO::storeValues($tag, $defaults);
-      return $tag;
-    }
-    return NULL;
+  public static function retrieve($params, &$defaults) {
+    return self::commonRetrieve(self::class, $params, $defaults);
   }
 
   /**