LLMS_Notification::load()

Load all notification data into the instance


Return Return

(self)


Top ↑

Source Source

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

	 */
	public function load() {

		global $wpdb;

		$notification = $wpdb->get_row(
			$wpdb->prepare( "SELECT created, updated, status, type, subscriber, trigger_id, user_id, post_id FROM {$this->get_table()} WHERE id = %d", $this->id ), // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
			ARRAY_A
		); // db call ok; no-cache ok.

		if ( $notification ) {

			foreach ( $notification as $key => $val ) {
				$this->$key = $val;
			}

			try {
				$this->html = $this->get_html();
			} catch ( Error $e ) {
				llms_log( sprintf( 'Error generating the HTML for the notification ID #%d', $this->id ) );
				llms_log( sprintf( 'Error caught %1$s in %2$s on line %3$s', $e->getMessage(), $e->getFile(), $e->getLine() ) );
				$this->set( 'status', 'error' );

Top ↑

Changelog Changelog

Changelog
Version Description
3.8.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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