LLMS_Abstract_Notification_View::__construct( mixed $notification )

Constructor


Description Description


Parameters Parameters

$notification

(mixed) (Required) Notification id, instance of LLMS_Notification or an object containing at least an 'id'.


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/abstracts/llms.abstract.notification.view.php

	public function __construct( $notification ) {

		if ( is_numeric( $notification ) ) {
			$this->id           = $notification;
			$this->notification = new LLMS_Notification( $notification );
		} elseif ( is_a( $notification, 'LLMS_Notification' ) ) {
			$this->id           = $notification->get( 'id' );
			$this->notification = $notification;
		} elseif ( is_object( $notification ) && isset( $notification->id ) ) {
			$this->id           = $notification->id;
			$this->notification = new LLMS_Notification( $notification->id );
		}

		$this->subscriber = new LLMS_Student( $this->notification->get( 'subscriber' ) );
		$this->user       = new LLMS_Student( $this->notification->get( 'user_id' ) );
		$this->post       = $this->get_object();

		$this->basic_options = apply_filters( $this->get_filter( 'basic_options' ), $this->basic_options, $this );

	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.8.0
3.37.19 Moved the retrieval of the associated llms post into a protected method.
3.31.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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