Course::get_course( $course = null )


Source

File: classes/Course.php

	public function get_course( $course = null ) {

		if ( $course instanceof Course ){
			return $course;
		}

		$course = get_post( $course );

		$this->id    = $course->ID;
		$this->title = get_the_title( $course );
		$this->post  = $course;


		$this->price_type = dozent_get_course_price_type( $course );

		$this->is_public    = ( $this->price_type === 'public' );
		$this->is_protected = ( $this->price_type === 'protected' );
		$this->is_free      = ( $this->price_type === 'free' );
		$this->is_closed    = ( $this->price_type === 'closed' );


		return $this;
	}