From c833139945584de8178baa79dff22419923d11b9 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 20 Sep 2023 18:23:44 -0700 Subject: [PATCH] PHP 7.x - Use get_class() instead of $object::class --- CRM/Core/DAO.php | 2 +- CRM/Utils/Hook.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Core/DAO.php b/CRM/Core/DAO.php index 300cc12086..bd7147725b 100644 --- a/CRM/Core/DAO.php +++ b/CRM/Core/DAO.php @@ -3170,7 +3170,7 @@ SELECT contact_id public static function getSelectWhereClause($tableAlias = NULL, $entityName = NULL, $conditions = []) { $bao = new static(); $tableAlias = $tableAlias ?? $bao->tableName(); - $entityName = $entityName ?? CRM_Core_DAO_AllCoreTables::getBriefName($bao::class); + $entityName = $entityName ?? CRM_Core_DAO_AllCoreTables::getBriefName(get_class($bao)); $finalClauses = []; $fields = static::getSupportedFields(); $selectWhereClauses = $bao->addSelectWhereClause($entityName, NULL, $conditions); diff --git a/CRM/Utils/Hook.php b/CRM/Utils/Hook.php index f6f96425d6..aa30ca0954 100644 --- a/CRM/Utils/Hook.php +++ b/CRM/Utils/Hook.php @@ -633,7 +633,7 @@ abstract class CRM_Utils_Hook { * Values from WHERE or ON clause */ public static function selectWhereClause($entity, array &$clauses, int $userId = NULL, array $conditions = []): void { - $entityName = is_object($entity) ? CRM_Core_DAO_AllCoreTables::getBriefName($entity::class) : $entity; + $entityName = is_object($entity) ? CRM_Core_DAO_AllCoreTables::getBriefName(get_class($entity)) : $entity; $null = NULL; $userId = $userId ?? (int) CRM_Core_Session::getLoggedInContactID(); self::singleton()->invoke(['entity', 'clauses', 'userId', 'conditions'], -- 2.25.1