Merge pull request #23190 from eileenmcnaughton/pradeep
[civicrm-core.git] / CRM / Core / BAO / LocationType.php
index 3e25675ce2ca315dcb8c70d3826bae33dcb63e96..6d119d7091645f6bc4d04d7f21ffd2fe837b09c8 100644 (file)
@@ -14,7 +14,7 @@
  * @package CRM
  * @copyright CiviCRM LLC https://civicrm.org/licensing
  */
-class CRM_Core_BAO_LocationType extends CRM_Core_DAO_LocationType implements \Civi\Test\HookInterface {
+class CRM_Core_BAO_LocationType extends CRM_Core_DAO_LocationType implements \Civi\Core\HookInterface {
 
   /**
    * @var CRM_Core_DAO_LocationType|null
@@ -27,24 +27,20 @@ class CRM_Core_BAO_LocationType extends CRM_Core_DAO_LocationType implements \Ci
   public static $_billingLocationType = NULL;
 
   /**
-   * 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 CRM_Core_DAO_LocationType|null
-   *   object on success, null otherwise
+   * @return self|null
+   *   The DAO object, if found.
+   *
+   * @deprecated
    */
-  public static function retrieve(&$params, &$defaults) {
-    $locationType = new CRM_Core_DAO_LocationType();
-    $locationType->copyValues($params);
-    if ($locationType->find(TRUE)) {
-      CRM_Core_DAO::storeValues($locationType, $defaults);
-      return $locationType;
-    }
-    return NULL;
+  public static function retrieve($params, &$defaults) {
+    return self::commonRetrieve(self::class, $params, $defaults);
   }
 
   /**