Memberpress_Courses_Helpers::find_all_by_course( integer $course_id )

Find all by course


Parameters Parameters

$course_id

(Required)


Top ↑

Return Return

(Uncanny_AutomatorSection[]) Array of Section objects ordered by section_order


Source Source

File: src/integrations/memberpress-courses/helpers/memberpress-courses-helpers.php

	public function find_all_by_course( $course_id ) {
		$db = new lib\Db();

		$records = $db->get_records( $db->sections, compact( 'course_id' ), 'section_order' );

		$sections = array();
		foreach ( $records as $rec ) {
			$sections[] = $rec->id;
		}

		return $sections;
	}