CRM_Core_DAO::executeQuery($sql, $params);
}
- /**
- * Delete pair from the previous next cache table to remove it from further merge consideration.
- *
- * The pair may have been flipped, so make sure we delete using both orders
- *
- * @param int $id1
- * @param int $id2
- * @param string $cacheKey
- */
- public static function deletePair($id1, $id2, $cacheKey = NULL) {
- $sql = "DELETE FROM civicrm_prevnext_cache WHERE entity_table = 'civicrm_contact'";
-
- $pair = "(entity_id1 = %2 AND entity_id2 = %3) OR (entity_id1 = %3 AND entity_id2 = %2)";
- $sql .= " AND ( {$pair} )";
- $params[2] = [$id1, 'Integer'];
- $params[3] = [$id2, 'Integer'];
-
- if (isset($cacheKey)) {
- $sql .= " AND cachekey LIKE %4";
- // used % to address any row with conflict-cacheKey e.g "merge Individual_8_0_conflicts"
- $params[4] = ["{$cacheKey}%", 'String'];
- }
-
- CRM_Core_DAO::executeQuery($sql, $params);
- }
-
/**
* Mark contacts as being in conflict.
*
* @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) {
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)) {
- Civi::log()->warning('Deprecated code path. Values should not be set this is going away in the future in favour of specific function params for each column.', array('civi.tag' => 'deprecated'));
+ 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]);
}
}
+ /**
+ * Old function to clean up he cache.
+ *
+ * @deprecated.
+ */
public static function cleanupCache() {
+ CRM_Core_Error::deprecatedFunctionWarning('Deprecated function');
Civi::service('prevnext')->cleanup();
}
* @see CRM_Core_PrevNextCache_Sql::getSelection()
*/
public static function getSelection($cacheKey, $action = 'get') {
+ CRM_Core_Error::deprecatedFunctionWarning('Deprecated function');
return Civi::service('prevnext')->getSelection($cacheKey, $action);
}
* @param array $fieldDef
* @param int $counter
* The globally-unique ID of the test object.
+ *
+ * @throws \CRM_Core_Exception
*/
protected function assignTestValue($fieldName, &$fieldDef, $counter) {
if ($fieldName === 'cachekey') {