LLMS_Sessions::get_session_events( LLMS_Event $start, array $args = array() )

Retrieve an array of events which occurred during a session.


Parameters Parameters

$start

(LLMS_Event) (Required) Event record for the session.start event.

$args

(array) (Optional) Array of additional arguments to pass to the LLMS_Events_Query.

Default value: array()


Top ↑

Return Return

(LLMS_Event[])


Top ↑

Source Source

File: includes/class-llms-sessions.php

	public function get_session_events( $start, $args = array() ) {

		$end = $this->get_session_end( $start );

		$args = wp_parse_args(
			$args,
			array(
				'date_after' => $start->get( 'date' ),
				'exclude'    => array( $start->get( 'id' ) ),
				'actor'      => $start->get( 'actor_id' ),
				'sort'       => array(
					'date' => 'ASC',
				),
				'per_page'   => 10,
			)
		);

		if ( $end ) {
			$args['date_before'] = $end->get( 'date' );
			$args['exclude'][]   = $end->get( 'id' );
		}

		$query = new LLMS_Events_Query( $args );
		return $query->get_events();

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.36.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.