From a987179c27665f638d65be73f060f1a88c689e4a Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Mon, 2 Jan 2023 16:26:38 +1300 Subject: [PATCH] Remove more deprecated functions --- CRM/Core/BAO/PrevNextCache.php | 47 ---------------------------------- 1 file changed, 47 deletions(-) diff --git a/CRM/Core/BAO/PrevNextCache.php b/CRM/Core/BAO/PrevNextCache.php index 22fcecc9af..1b5ee2f3d8 100644 --- a/CRM/Core/BAO/PrevNextCache.php +++ b/CRM/Core/BAO/PrevNextCache.php @@ -295,53 +295,6 @@ FROM civicrm_prevnext_cache pn return (@CRM_Utils_String::unserialize($string) !== FALSE); } - /** - * @param string $sqlValues string of SQLValues to insert - * @return array - */ - public static function convertSetItemValues($sqlValues) { - CRM_Core_Error::deprecatedFunctionWarning('Deprecated function'); - $closingBrace = strpos($sqlValues, ')') - strlen($sqlValues); - $valueArray = array_map('trim', explode(', ', substr($sqlValues, strpos($sqlValues, '(') + 1, $closingBrace - 1))); - foreach ($valueArray as $key => &$value) { - // remove any quotes from values. - if (substr($value, 0, 1) == "'") { - $valueArray[$key] = substr($value, 1, -1); - } - } - return $valueArray; - } - - /** - * @deprecated - * - * @param array|string $entity_table - * @param int $entity_id1 - * @param int $entity_id2 - * @param string $cacheKey - * @param string $data - */ - public static function setItem($entity_table = NULL, $entity_id1 = NULL, $entity_id2 = NULL, $cacheKey = NULL, $data = NULL) { - CRM_Core_Error::deprecatedFunctionWarning('Deprecated function'); - // If entity table is an array we are passing in an older format where this function only had 1 param $values. We put a deprecation warning. - if (!empty($entity_table) && is_array($entity_table)) { - CRM_Core_Error::deprecatedWarning('Deprecated code path. Values should not be set this is going away in the future in favour of specific function params for each column.'); - foreach ($values as $value) { - $valueArray = self::convertSetItemValues($value); - self::setItem($valueArray[0], $valueArray[1], $valueArray[2], $valueArray[3], $valueArray[4]); - } - } - else { - CRM_Core_DAO::executeQuery("INSERT INTO civicrm_prevnext_cache (entity_table, entity_id1, entity_id2, cacheKey, data) VALUES - (%1, %2, %3, %4, '{$data}')", [ - 1 => [$entity_table, 'String'], - 2 => [$entity_id1, 'Integer'], - 3 => [$entity_id2, 'Integer'], - 4 => [$cacheKey, 'String'], - ]); - } - } - /** * Get count of matching rows. * -- 2.25.1