foreach ($this->tokens as $i => $token) {
$sub = $uf->addNameTokensFilter($token);
if ($this->soundex) {
- $c = XDB::format($sub . '.soundex = {?}', $token);
+ $c = XDB::format($sub . '.soundex = {?}', soundex_fr($token));
} else if ($this->exact) {
$c = XDB::format($sub . '.token = {?}', $token);
} else {
{
// Groups have AX visibility.
if ($uf->getVisibilityLevel() == ProfileVisibility::VIS_PUBLIC) {
- return PlFilter::COND_TRUE;
+ return self::COND_TRUE;
}
$sub = $uf->addGroupFilter($this->group);
$where = 'gpm' . $sub . '.perms IS NOT NULL';
{
// Binets are private.
if ($uf->getVisibilityLevel() != ProfileVisibility::VIS_PRIVATE) {
- return PlFilter::COND_TRUE;
+ return self::CONF_TRUE;
}
$sub = $uf->addBinetsFilter();
return XDB::format($sub . '.binet_id IN {?}', $this->val);
{
// Sections are private.
if ($uf->getVisibilityLevel() != ProfileVisibility::VIS_PRIVATE) {
- return PlFilter::COND_TRUE;
+ return self::CONF_TRUE;
}
$uf->requireProfiles();
return XDB::format('p.section IN {?}', $this->section);
// don't do anything. Otherwise restrict to standard job visibility.
if ($this->fields == UserFilter::JOB_CV) {
if ($uf->getVisibilityLevel() != ProfileVisibility::VIS_PRIVATE) {
- return PlFilter::COND_TRUE;
+ return self::CONF_TRUE;
}
} else {
$conds[] = $uf->getVisibilityCondition($jsub . '.pub');
if ($this->fields & UserFilter::JOB_USERDEFINED) {
$conds[] = $jsub . '.description ' . XDB::formatWildcards(XDB::WILDCARD_CONTAINS, $this->description);
}
- if ($this->fields & UserFilter::JOB_CV && $uf->getVisibilityLevel == ProfileVisibility::VIS_PRIVATE) {
+ if ($this->fields & UserFilter::JOB_CV && $uf->getVisibilityLevel() == ProfileVisibility::VIS_PRIVATE) {
$uf->requireProfiles();
$conds[] = 'p.cv ' . XDB::formatWildcards(XDB::WILDCARD_CONTAINS, $this->description);
}
$this->buildQuery();
$token = $this->grouper->getGroupToken($this);
- $groups = XDB::fetchAllRow('SELECT ' . $token . ', COUNT(a.uid)
- ' . $this->query . '
- GROUP BY ' . $token,
- 0);
+ $groups = XDB::rawFetchAllRow('SELECT ' . $token . ', COUNT(a.uid)
+ ' . $this->query . '
+ GROUP BY ' . $token,
+ 0);
return $groups;
}
$this->buildQuery();
$token = $this->grouper->getGroupToken($this);
- $groups = XDB::fetchAllRow('SELECT ' . $token . ', COUNT(p.pid)
- ' . $this->query . '
- GROUP BY ' . $token,
- 0);
+ $groups = XDB::rawFetchAllRow('SELECT ' . $token . ', COUNT(p.pid)
+ ' . $this->query . '
+ GROUP BY ' . $token,
+ 0);
return $groups;
}
if (!empty($uids)) {
$cond = XDB::format(' AND a.uid IN {?}', $uids);
}
- $fetched = XDB::fetchColumn('SELECT SQL_CALC_FOUND_ROWS a.uid
- ' . $this->query . $cond . '
- GROUP BY a.uid
- ' . $this->orderby . '
- ' . $lim);
+ $fetched = XDB::rawFetchColumn('SELECT SQL_CALC_FOUND_ROWS a.uid
+ ' . $this->query . $cond . '
+ GROUP BY a.uid
+ ' . $this->orderby . '
+ ' . $lim);
$this->lastusercount = (int)XDB::fetchOneCell('SELECT FOUND_ROWS()');
return $fetched;
}
if (!is_null($pids)) {
$cond = XDB::format(' AND p.pid IN {?}', $pids);
}
- $fetched = XDB::fetchColumn('SELECT SQL_CALC_FOUND_ROWS p.pid
- ' . $this->query . $cond . '
- GROUP BY p.pid
- ' . $this->orderby . '
- ' . $lim);
+ $fetched = XDB::rawFetchColumn('SELECT SQL_CALC_FOUND_ROWS p.pid
+ ' . $this->query . $cond . '
+ GROUP BY p.pid
+ ' . $this->orderby . '
+ ' . $lim);
$this->lastprofilecount = (int)XDB::fetchOneCell('SELECT FOUND_ROWS()');
return $fetched;
}
{
$this->requireAccounts();
$this->buildQuery();
- $count = (int)XDB::fetchOneCell('SELECT COUNT(*)
- ' . $this->query . XDB::format(' AND a.uid = {?}', $user->id()));
+ $count = (int)XDB::rawFetchOneCell('SELECT COUNT(*)
+ ' . $this->query
+ . XDB::format(' AND a.uid = {?}', $user->id()));
return $count == 1;
}
{
$this->requireProfiles();
$this->buildQuery();
- $count = (int)XDB::fetchOneCell('SELECT COUNT(*)
- ' . $this->query . XDB::format(' AND p.pid = {?}', $profile->id()));
+ $count = (int)XDB::rawFetchOneCell('SELECT COUNT(*)
+ ' . $this->query
+ . XDB::format(' AND p.pid = {?}', $profile->id()));
return $count == 1;
}
if (is_null($this->lastusercount)) {
$this->requireAccounts();
$this->buildQuery();
- return (int)XDB::fetchOneCell('SELECT COUNT(DISTINCT a.uid)
+ return (int)XDB::rawFetchOneCell('SELECT COUNT(DISTINCT a.uid)
' . $this->query);
} else {
return $this->lastusercount;
if (is_null($this->lastprofilecount)) {
$this->requireProfiles();
$this->buildQuery();
- return (int)XDB::fetchOneCell('SELECT COUNT(DISTINCT p.pid)
+ return (int)XDB::rawFetchOneCell('SELECT COUNT(DISTINCT p.pid)
' . $this->query);
} else {
return $this->lastprofilecount;