phpBB API Documentation
Interface

phpbb\notification\type\type_interface

interface type_interface

Base notifications interface

Methods

string get_type()

Get notification type name

set_initial_data(array $data)

Set initial data from the database

static  get_item_id(array $type_data)

Get the id of the item

static  get_item_parent_id(array $type_data)

Get the id of the parent

bool is_available()

Is this type available to the current user (defines whether or not it will be shown in the UCP Edit notification options)

array find_users_for_notification(array $type_data, array $options)

Find the users who want to receive notifications

array users_to_query()

Users needed to query before this notification can be displayed

array get_load_special()

Get the special items to load

load_special(array $data, array $notifications)

Load the special items

string get_style_class()

Get the CSS style class of the notification

string get_title()

Get the HTML formatted title of this notification

string get_reference()

Get the HTML formatted reference of the notification

string get_forum()

Get the forum of the notification reference

string get_url()

Get the url to this item

string get_redirect_url()

Get the url to redirect after the item has been marked as read

get_unsubscribe_url(string|bool $method)

URL to unsubscribe to this notification

string get_avatar()

Get the user's avatar (the user who caused the notification typically)

prepare_for_display()

Prepare to output the notification to the template

string|bool get_email_template()

Get email template

array get_email_template_variables()

Get email template variables

array pre_create_insert_array(array $type_data, array $notify_users)

Pre create insert array function This allows you to perform certain actions, like run a query and load data, before createinsertarray() is run.

create_insert_array(array $type_data, array $pre_create_data)

Function for preparing the data for insertion in an SQL query

array get_insert_array()

Function for getting the data for insertion in an SQL query

array create_update_array(array $type_data)

Function for preparing the data for update in an SQL query (The service handles insertion)

string mark_read(bool $return = false)

Mark this item read

string mark_unread(bool $return = false)

Mark this item unread

Details

at line 26
public string get_type()

Get notification type name

Return Value

string

at line 33
public set_initial_data(array $data)

Set initial data from the database

Parameters

array $data Row directly from the database

at line 40
static public get_item_id(array $type_data)

Get the id of the item

Parameters

array $type_data The type specific data

at line 47
static public get_item_parent_id(array $type_data)

Get the id of the parent

Parameters

array $type_data The type specific data

at line 54
public bool is_available()

Is this type available to the current user (defines whether or not it will be shown in the UCP Edit notification options)

Return Value

bool True/False whether or not this is available to the user

at line 66
public array find_users_for_notification(array $type_data, array $options)

Find the users who want to receive notifications

Parameters

array $type_data The type specific data
array $options Options for finding users for notification ignore_users => array of users and user types that should not receive notifications from this type because they've already been notified e.g.: array(2 => array(''), 3 => array('', 'email'), ...)

Return Value

array

at line 73
public array users_to_query()

Users needed to query before this notification can be displayed

Return Value

array Array of user_ids

at line 80
public array get_load_special()

Get the special items to load

Return Value

array Data will be combined sent to load_special() so you can run a single query and get data required for this notification type

at line 88
public load_special(array $data, array $notifications)

Load the special items

Parameters

array $data Data from getloadspecial()
array $notifications Array of notifications (key is notification_id, value is the notification objects)

at line 95
public string get_style_class()

Get the CSS style class of the notification

Return Value

string

at line 102
public string get_title()

Get the HTML formatted title of this notification

Return Value

string

at line 109
public string get_reference()

Get the HTML formatted reference of the notification

Return Value

string

at line 116
public string get_forum()

Get the forum of the notification reference

Return Value

string

at line 123
public string get_url()

Get the url to this item

Return Value

string URL

at line 130
public string get_redirect_url()

Get the url to redirect after the item has been marked as read

Return Value

string URL

at line 137
public get_unsubscribe_url(string|bool $method)

URL to unsubscribe to this notification

Parameters

string|bool $method Method name to unsubscribe from (email|jabber|etc), False to unsubscribe from all notifications for this item

at line 144
public string get_avatar()

Get the user's avatar (the user who caused the notification typically)

Return Value

string

at line 149
public prepare_for_display()

Prepare to output the notification to the template

at line 156
public string|bool get_email_template()

Get email template

Return Value

string|bool

at line 163
public array get_email_template_variables()

Get email template variables

Return Value

array

at line 176
public array pre_create_insert_array(array $type_data, array $notify_users)

Pre create insert array function This allows you to perform certain actions, like run a query and load data, before createinsertarray() is run.

The data returned from this function will be sent to createinsertarray().

Parameters

array $type_data The type specific data
array $notify_users Notify users list Formated from findusersfor_notification()

Return Value

array Whatever you want to send to createinsertarray().

at line 184
public create_insert_array(array $type_data, array $pre_create_data)

Function for preparing the data for insertion in an SQL query

Parameters

array $type_data The type specific data
array $pre_create_data Data from precreateinsert_array()

at line 191
public array get_insert_array()

Function for getting the data for insertion in an SQL query

Return Value

array Array of data ready to be inserted into the database

at line 201
public array create_update_array(array $type_data)

Function for preparing the data for update in an SQL query (The service handles insertion)

Parameters

array $type_data Data unique to this notification type

Return Value

array Array of data ready to be updated in the database

at line 209
public string mark_read(bool $return = false)

Mark this item read

Parameters

bool $return True to return a string containing the SQL code to update this item, False to execute it (Default: False)

Return Value

string

at line 217
public string mark_unread(bool $return = false)

Mark this item unread

Parameters

bool $return True to return a string containing the SQL code to update this item, False to execute it (Default: False)

Return Value

string