User_Notifications
in package
User notifications functionality.
Applies to any person with login credentials. Shows notifications on the user home page.
Tags
Table of Contents
Properties
- $instances : array<string|int, object>
- The array of instances of this class and sub-classes.
- $messages : Messages
- The instance of the Messages class.
- $user : User
- The instance of the User class.
Methods
- get_instance() : object
- Creates and/or returns the instance of this class.
- render() : void
- Maybe render the user notifications section.
- __construct() : void
- Initialise the class.
- get_notifications() : array<string|int, string>
- Return marked up notifications.
Properties
$instances
The array of instances of this class and sub-classes.
protected
static array<string|int, object>
$instances
= array()
Tags
$messages
The instance of the Messages class.
protected
Messages
$messages
Tags
$user
The instance of the User class.
protected
User
$user
Tags
Methods
get_instance()
Creates and/or returns the instance of this class.
public
static get_instance() : object
Tags
Return values
object —The instance of this class.
render()
Maybe render the user notifications section.
public
render() : void
This will only echo output if there are notifications to show.
Tags
__construct()
Initialise the class.
protected
__construct() : void
Tags
get_notifications()
Return marked up notifications.
protected
get_notifications([int $user_id = 0 ]) : array<string|int, string>
This will only echo output if there are notifications to show.
Parameters
- $user_id : int = 0
-
The user id.
Tags
Return values
array<string|int, string> —An array of marked up notifications,