LLMS_Sessions::get_session_end( LLMS_Event $start )
Retrieve session end record for by session id.
Parameters Parameters
- $start
-
(LLMS_Event) (Required) Event record for the session.start event.
Return Return
(LLMS_Event|end)
Source Source
File: includes/class-llms-sessions.php
364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 | public function get_session_end( $start ) { global $wpdb ; $end = $wpdb ->get_var( $wpdb ->prepare( "SELECT id FROM { $wpdb ->prefix}lifterlms_events WHERE actor_id = %d AND object_id = %d AND object_type = 'session' AND event_type = 'session' AND event_action = 'end' ORDER BY date DESC LIMIT 1;", $start ->get( 'actor_id' ), $start ->get( 'object_id' ) ) ); // db call ok; no-cache ok. if ( ! $end ) { return null; } return new LLMS_Event( $end ); } |
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.36.0 | Introduced. |