Merge pull request #23897 from agh1/5.51.0-releasenotes-initial
[civicrm-core.git] / CRM / Pledge / BAO / PledgePayment.php
index ee063dd3aa3b2f8489b580908fa513f9bda8eef1..b5097073653592836c9a9503a9a80defd7282b2d 100644 (file)
@@ -171,25 +171,20 @@ WHERE     pledge_id = %1
   }
 
   /**
-   * Retrieve DB object based on input parameters.
-   *
-   * It also stores all the retrieved values in the default array.
+   * 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_Pledge_BAO_PledgePayment
+   * @deprecated
    */
-  public static function retrieve(&$params, &$defaults) {
-    $payment = new CRM_Pledge_BAO_PledgePayment();
-    $payment->copyValues($params);
-    if ($payment->find(TRUE)) {
-      CRM_Core_DAO::storeValues($payment, $defaults);
-      return $payment;
-    }
-    return NULL;
+  public static function retrieve($params, &$defaults) {
+    return self::commonRetrieve(self::class, $params, $defaults);
   }
 
   /**
@@ -464,8 +459,8 @@ WHERE  civicrm_pledge.id = %2
    *
    * @param array $params
    *
-   * @return array
-   *   Next scheduled date as an array
+   * @return string
+   *   Next scheduled date in the format YmdHis
    */
   public static function calculateBaseScheduleDate(&$params) {
     $date = [];