public static function OpignoTourFunctions::isPageUserViewed in Opigno tour 3.x
Same name and namespace in other branches
- 8 src/OpignoTourFunctions.php \Drupal\opigno_tour\OpignoTourFunctions::isPageUserViewed()
Checks if user has already viewed current page.
1 call to OpignoTourFunctions::isPageUserViewed()
- opigno_tour_preprocess_page in ./
opigno_tour.module - Implements hook_preprocess_page().
File
- src/
OpignoTourFunctions.php, line 34
Class
- OpignoTourFunctions
- Class OpignoTourFunctions.
Namespace
Drupal\opigno_tourCode
public static function isPageUserViewed($route_name, $uid) {
$viewed = \Drupal::database()
->select('opigno_tour_user_routes', 'ur')
->fields('ur', [
'timestamp',
])
->condition('uid', $uid)
->condition('route', $route_name)
->execute()
->fetchAll();
if ($viewed) {
return TRUE;
}
return FALSE;
}