本文整理汇总了PHP中AJXP_Utils::cleanLike方法的典型用法代码示例。如果您正苦于以下问题:PHP AJXP_Utils::cleanLike方法的具体用法?PHP AJXP_Utils::cleanLike怎么用?PHP AJXP_Utils::cleanLike使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AJXP_Utils
的用法示例。
在下文中一共展示了AJXP_Utils::cleanLike方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUsersCount
public function getUsersCount($baseGroup = "/", $regexp = "", $filterProperty = null, $filterValue = null, $recursive = true)
{
// WITH PARENT
// SELECT COUNT(*) FROM ajxp_users AS u, ajxp_user_rights AS r WHERE u.groupPath LIKE '/%' AND r.login=u.login AND r.repo_uuid = 'ajxp.parent_user'
// WITH SPECIFIC PARENT 'username'
// SELECT COUNT(*) FROM ajxp_users AS u, ajxp_user_rights AS r WHERE u.groupPath LIKE '/%' AND r.login=u.login AND r.repo_uuid = 'ajxp.parent_user' AND r.rights = 'username'
// WITHOUT PARENT
// SELECT COUNT(*) FROM ajxp_users AS u WHERE NOT EXISTS (SELECT * FROM ajxp_user_rights AS c WHERE c.login=u.login AND c.repo_uuid='ajxp.parent_user')
$ands = array();
$select = "SELECT COUNT(*) FROM [ajxp_users] AS u WHERE %and";
if (!empty($regexp)) {
$ands[] = array("[u.login] " . AJXP_Utils::regexpToLike($regexp), AJXP_Utils::cleanRegexp($regexp));
}
if ($recursive) {
$ands[] = array("[u.groupPath] LIKE %like~", $baseGroup);
} else {
$ands[] = array("[u.groupPath] = %s", $baseGroup);
}
$ands[] = array("NOT EXISTS (SELECT * FROM [ajxp_user_rights] AS c WHERE [c.login]=[u.login] AND [c.repo_uuid] = 'ajxp.hidden')");
if ($filterProperty !== null && $filterValue !== null) {
if ($filterProperty == "parent") {
$filterProperty = "ajxp.parent_user";
} else {
if ($filterProperty == "admin") {
$filterProperty = "ajxp.admin";
}
}
if ($filterValue == AJXP_FILTER_EMPTY) {
$ands[] = array("NOT EXISTS (SELECT * FROM [ajxp_user_rights] AS c WHERE [c.login]=[u.login] AND [c.repo_uuid] = %s)", $filterProperty);
} else {
if ($filterValue == AJXP_FILTER_NOT_EMPTY) {
$select = "SELECT COUNT(*) FROM [ajxp_users] AS u, [ajxp_user_rights] AS r WHERE %and";
$ands[] = array("[r.login]=[u.login]");
$ands[] = array("[r.repo_uuid] = %s", $filterProperty);
} else {
$select = "SELECT COUNT(*) FROM [ajxp_users] AS u, [ajxp_user_rights] AS r WHERE %and";
$ands[] = array("[r.login]=[u.login]");
$ands[] = array("[r.repo_uuid] = %s", $filterProperty);
$ands[] = array("[r.rights] " . AJXP_Utils::likeToLike($filterValue), AJXP_Utils::cleanLike($filterValue));
}
}
}
$res = dibi::query($select, $ands);
return $res->fetchSingle();
}