protected function MongodbSessionHandler::findOne in MongoDB 8
Tries to find a session and an according user.
Parameters
$conditions:
Return value
array|mixed|null
1 call to MongodbSessionHandler::findOne()
- MongodbSessionHandler::read in mongodb_user/
src/ MongodbSessionHandler.php
File
- mongodb_user/
src/ MongodbSessionHandler.php, line 81 - Contains \Drupal\mongodb_user\MongodbSessionHandler.
Class
Namespace
Drupal\mongodb_userCode
protected function findOne($conditions) {
$session = $this
->mongoCollection()
->findOne($conditions);
if ($session) {
$query['values.default_langcode.value'] = 1;
$query['_id'] = $session['uid'];
if ($user_record = $this->mongo
->get('entity.user')
->findOne($query, [
'session',
])) {
$session += $user_record['session'];
}
else {
$session = FALSE;
}
}
return $session;
}