LLMS_Order::start_access()

Record the start date of the access plan and schedule expiration if expiration is required in the future


Return Return

(void)


Top ↑

Source Source

File: includes/models/model.llms.order.php

	public function start_access() {

		// Only start access if access isn't already started.
		$date = $this->get( 'start_date' );
		if ( ! $date ) {

			// Set the start date to now.
			$date = llms_current_time( 'mysql' );
			$this->set( 'start_date', $date );

		}

		$this->unschedule_expiration();

		// Setup expiration.
		if ( in_array( $this->get( 'access_expiration' ), array( 'limited-date', 'limited-period' ), true ) ) {

			$expires_date = $this->get_access_expiration_date( 'Y-m-d H:i:s' );
			$this->set( 'date_access_expires', $expires_date );
			$this->maybe_schedule_expiration();

		}

	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.2.0 Use strict type comparision.
3.19.0 Unknown.
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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