LLMS_Table_Achievements::get_results( array $args = array() )

Get table results.


Parameters Parameters

$args

(array) (Optional) Table query arguments.

Default value: array()


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/admin/reporting/tables/llms.table.achievements.php

	public function get_results( $args = array() ) {

		$args = $this->clean_args( $args );

		$student_id = is_numeric( $args['student'] ) ? absint( $args['student'] ) : ( $args['student'] ? $args['student']->get_id() : 0 );
		if ( $student_id && ! current_user_can( 'view_others_lifterlms_reports' ) && ! llms_current_user_can( 'view_lifterlms_reports', $student_id ) ) {
			return;
		}

		if ( is_numeric( $args['student'] ) ) {
			$args['student'] = new LLMS_Student( $args['student'] );
		}

		$this->student = $args['student'];

		if ( isset( $args['page'] ) ) {
			$this->current_page = absint( $args['page'] );
		}

		$query = $this->student->get_achievements(
			array(
				'per_page' => 10,
				'status'   => array( 'publish', 'future' ),
				'paged'    => $this->current_page,
				'sort'     => array(
					'date' => 'ASC',
					'ID'   => 'ASC',
				),
			)
		);

		$this->max_pages = $query->get_max_pages();

		if ( $this->max_pages > $this->current_page ) {
			$this->is_last_page = false;
		}

		$this->tbody_data = $query->get_awards();
	}


Top ↑

Changelog Changelog

Changelog
Version Description
6.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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