BAO_Contact - Remove CRM_Utils_Array::value and other unnecessary code
[civicrm-core.git] / CRM / Core / OptionValue.php
index e803d8e53bb6308c3bc39a98b62df99cbe49cf32..27581b35cb3e82114c7ddc8f74dd8050c7e0745a 100644 (file)
@@ -1,34 +1,18 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 5                                                  |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2020                                |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM.                                    |
- |                                                                    |
- | CiviCRM is free software; you can copy, modify, and distribute it  |
- | under the terms of the GNU Affero General Public License           |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |
- |                                                                    |
- | CiviCRM is distributed in the hope that it will be useful, but     |
- | WITHOUT ANY WARRANTY; without even the implied warranty of         |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |
- | See the GNU Affero General Public License for more details.        |
+ | Copyright CiviCRM LLC. All rights reserved.                        |
  |                                                                    |
- | You should have received a copy of the GNU Affero General Public   |
- | License and the CiviCRM Licensing Exception along                  |
- | with this program; if not, contact CiviCRM LLC                     |
- | at info[AT]civicrm[DOT]org. If you have questions about the        |
- | GNU Affero General Public License or the licensing of CiviCRM,     |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
+ | This work is published under the GNU AGPLv3 license with some      |
+ | permitted exceptions and without any warranty. For full license    |
+ | and copyright information, see https://civicrm.org/licensing       |
  +--------------------------------------------------------------------+
  */
 
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2020
+ * @copyright CiviCRM LLC https://civicrm.org/licensing
  */
 class CRM_Core_OptionValue {
 
@@ -86,7 +70,7 @@ class CRM_Core_OptionValue {
       $optionGroupID = $groupParams['id'];
     }
 
-    $groupName = CRM_Utils_Array::value('name', $groupParams);
+    $groupName = $groupParams['name'] ?? NULL;
     if (!$groupName && $optionGroupID) {
       $groupName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup',
         $optionGroupID, 'name', 'id'
@@ -277,7 +261,7 @@ class CRM_Core_OptionValue {
     }
 
     if ($object->find(TRUE)) {
-      return ($daoID && $object->id == $daoID) ? TRUE : FALSE;
+      return $daoID && $object->id == $daoID;
     }
     else {
       return TRUE;
@@ -434,8 +418,8 @@ FROM
 
     $order = " ORDER BY " . $orderBy;
 
-    $groupId = CRM_Utils_Array::value('id', $groupParams);
-    $groupName = CRM_Utils_Array::value('name', $groupParams);
+    $groupId = $groupParams['id'] ?? NULL;
+    $groupName = $groupParams['name'] ?? NULL;
 
     if ($groupId) {
       $where .= " AND option_group.id = %1";