Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UFMatch - deprecate unused functions #16849

Merged
merged 1 commit into from
Mar 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions CRM/Core/BAO/UFMatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -519,21 +519,24 @@ public static function getUFId($contactID) {
}

/**
* @deprecated
* @return bool
*/
public static function isEmptyTable() {
CRM_Core_Error::deprecatedFunctionWarning('unused function to be removed');
$sql = "SELECT count(id) FROM civicrm_uf_match";
return CRM_Core_DAO::singleValueQuery($sql) > 0 ? FALSE : TRUE;
}

/**
* Get the list of contact_id.
*
*
* @deprecated
* @return int
* contact_id on success, null otherwise
*/
public static function getContactIDs() {
CRM_Core_Error::deprecatedFunctionWarning('unused function to be removed');
$id = [];
$dao = new CRM_Core_DAO_UFMatch();
$dao->find();
Expand All @@ -546,13 +549,14 @@ public static function getContactIDs() {
/**
* See if this user exists, and if so, if they're allowed to login
*
*
* @deprecated
* @param int $openId
*
* @return bool
* true if allowed to login, false otherwise
*/
public static function getAllowedToLogin($openId) {
CRM_Core_Error::deprecatedFunctionWarning('unused function to be removed');
$ufmatch = new CRM_Core_DAO_UFMatch();
$ufmatch->uf_name = $openId;
$ufmatch->allowed_to_login = 1;
Expand All @@ -566,11 +570,12 @@ public static function getAllowedToLogin($openId) {
* Get the next unused uf_id value, since the standalone UF doesn't
* have id's (it uses OpenIDs, which go in a different field)
*
*
* @deprecated
* @return int
* next highest unused value for uf_id
*/
public static function getNextUfIdValue() {
CRM_Core_Error::deprecatedFunctionWarning('unused function to be removed');
$query = "SELECT MAX(uf_id)+1 AS next_uf_id FROM civicrm_uf_match";
$dao = CRM_Core_DAO::executeQuery($query);
if ($dao->fetch()) {
Expand All @@ -585,10 +590,11 @@ public static function getNextUfIdValue() {

/**
* @param $email
*
* @deprecated
* @return bool
*/
public static function isDuplicateUser($email) {
CRM_Core_Error::deprecatedFunctionWarning('unused function to be removed');
$session = CRM_Core_Session::singleton();
$contactID = $session->get('userID');
if (!empty($email) && isset($contactID)) {
Expand Down