[REF] - Deprecate & delegate BAO::retrieve
[civicrm-core.git] / CRM / Contribute / BAO / ContributionSoft.php
index 7d93a9250a577dd9d54d6e1e27259c5273f72b27..3c7ea77885feb82eeb6f2a8f088cfbb5fd47a59a 100644 (file)
@@ -173,23 +173,20 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio
   }
 
   /**
-   * 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 self|null
+   *   The DAO object, if found.
    *
-   * @return CRM_Contribute_BAO_ContributionSoft
+   * @deprecated
    */
-  public static function retrieve(&$params, &$defaults) {
-    $contributionSoft = new CRM_Contribute_DAO_ContributionSoft();
-    $contributionSoft->copyValues($params);
-    if ($contributionSoft->find(TRUE)) {
-      CRM_Core_DAO::storeValues($contributionSoft, $defaults);
-      return $contributionSoft;
-    }
-    return NULL;
+  public static function retrieve($params, &$defaults) {
+    return self::commonRetrieve(self::class, $params, $defaults);
   }
 
   /**