Merge in 5.16
[civicrm-core.git] / CRM / Core / OptionGroup.php
index 94368ec6a30a3586f9d90e298ac8badb6b098e3f..2a4324e6cdd3839ce950371cbc379d3eba61fae9 100644 (file)
  * @copyright CiviCRM LLC (c) 2004-2019
  */
 class CRM_Core_OptionGroup {
-  static $_values = [];
-  static $_cache = [];
+  public static $_values = [];
+  public static $_cache = [];
 
   /**
    * $_domainIDGroups array maintains the list of option groups for whom
    * domainID is to be considered.
+   * @var array
    */
-  static $_domainIDGroups = [
+  public static $_domainIDGroups = [
     'from_email_address',
     'grant_type',
   ];
@@ -333,7 +334,7 @@ WHERE  v.option_group_id = g.id
   }
 
   /**
-   * @deprecated - use CRM_Core_Pseudoconstant::getLabel
+   * @deprecated - use CRM_Core_PseudoConstant::getLabel
    *
    * @param string $groupName
    * @param $value
@@ -415,10 +416,8 @@ WHERE  v.option_group_id = g.id
     ];
     $dao = CRM_Core_DAO::executeQuery($query, $p);
     if ($dao->fetch()) {
-      $dao->free();
       return $dao->value;
     }
-    $dao->free();
     return NULL;
   }
 
@@ -615,13 +614,13 @@ WHERE  v.option_group_id = g.id
 
     if ($dao->fetch()) {
       foreach ([
-                 'id',
-                 'name',
-                 'value',
-                 'label',
-                 'weight',
-                 'description',
-               ] as $fld) {
+        'id',
+        'name',
+        'value',
+        'label',
+        'weight',
+        'description',
+      ] as $fld) {
         $row[$fld] = $dao->$fld;
         if ($localize && in_array($fld, ['label', 'description'])) {
           $row[$fld] = ts($row[$fld]);