private function SocialProfileTrait::startQuery in Open Social 8.4
Same name and namespace in other branches
- 8.9 modules/social_features/social_profile/src/SocialProfileTrait.php \Drupal\social_profile\SocialProfileTrait::startQuery()
- 8.5 modules/social_features/social_profile/src/SocialProfileTrait.php \Drupal\social_profile\SocialProfileTrait::startQuery()
- 8.6 modules/social_features/social_profile/src/SocialProfileTrait.php \Drupal\social_profile\SocialProfileTrait::startQuery()
- 8.7 modules/social_features/social_profile/src/SocialProfileTrait.php \Drupal\social_profile\SocialProfileTrait::startQuery()
- 8.8 modules/social_features/social_profile/src/SocialProfileTrait.php \Drupal\social_profile\SocialProfileTrait::startQuery()
- 10.3.x modules/social_features/social_profile/src/SocialProfileTrait.php \Drupal\social_profile\SocialProfileTrait::startQuery()
- 10.0.x modules/social_features/social_profile/src/SocialProfileTrait.php \Drupal\social_profile\SocialProfileTrait::startQuery()
- 10.1.x modules/social_features/social_profile/src/SocialProfileTrait.php \Drupal\social_profile\SocialProfileTrait::startQuery()
- 10.2.x modules/social_features/social_profile/src/SocialProfileTrait.php \Drupal\social_profile\SocialProfileTrait::startQuery()
Start a Social Profile Mention Query.
Return value
\Drupal\Core\Database\Query\SelectInterface Returns the query object.
1 call to SocialProfileTrait::startQuery()
- SocialProfileTrait::getUserIdsFromName in modules/
social_features/ social_profile/ src/ SocialProfileTrait.php - Get a list of account IDs whose account names begin with the given string.
File
- modules/
social_features/ social_profile/ src/ SocialProfileTrait.php, line 89
Class
- SocialProfileTrait
- Trait SocialProfileTrait.
Namespace
Drupal\social_profileCode
private function startQuery() {
$connection = \Drupal::database();
$query = $connection
->select('users', 'u')
->fields('u', [
'uid',
]);
$query
->join('users_field_data', 'uf', 'uf.uid = u.uid');
$query
->leftJoin('profile', 'p', 'p.uid = u.uid');
$query
->leftJoin('profile__field_profile_first_name', 'fn', 'fn.entity_id = p.profile_id');
$query
->leftJoin('profile__field_profile_last_name', 'ln', 'ln.entity_id = p.profile_id');
if ($this
->addNickName() === TRUE) {
$query
->leftJoin('profile__field_profile_nick_name', 'nn', 'nn.entity_id = p.profile_id');
}
$query
->condition('uf.status', 1);
return $query;
}