/**
* Check if the session record exists
*
* @param string $sessionId The session ID to check
*
* @return integer Status value for record presence
*
* @since 4.0.0
*/
private function checkSessionRecordExists(string $sessionId) : int
{
$query = $this->db->getQuery(true)->select($this->db->quoteName('session_id'))->from($this->db->quoteName('#__session'))->where($this->db->quoteName('session_id') . ' = :session_id')->bind(':session_id', $sessionId)->setLimit(1);
$this->db->setQuery($query);
try {
$exists = $this->db->loadResult();
} catch (ExecutionFailureException $e) {
return self::$sessionRecordUnknown;
}
if ($exists) {
return self::$sessionRecordExists;
}
return self::$sessionRecordDoesNotExist;
}