phpBB API Documentation
Class

phpbb\notification\type\report_pm

class report_pm extends pm

Private message reported notifications class This class handles notifications for private messages when they are reported

Properties

static bool|array $notification_option Notification option data (for outputting to the user)

Methods

__construct(driver_interface $db, language $language, user $user, auth $auth, string $phpbb_root_path, string $php_ext, string $user_notifications_table)

Notification Type Base Constructor

from base
set_notification_manager(manager $notification_manager)

Set notification manager (required)

from base
set_initial_data(array $data = array())

Set initial data from the database

from base
mixed __get(mixed $name)

Magic method to get data from this notification

from base
null __set(mixed $name, mixed $value)

Magic method to set data on this notification

from base
mixed __toString()

Magic method to get a string of this notification

from base
create_insert_array($post, array $pre_create_data = array())

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

from base
array create_update_array(array $type_data)

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

from base
string|null mark_read(bool $return = false)

Mark this item read

from base
string|null mark_unread(bool $return = false)

Mark this item unread

from base
string get_redirect_url()

{inheritDoc}

from base
array prepare_for_display()

Prepare to output the notification to the template

from base
false get_unsubscribe_url(string|bool $method = false)

URL to unsubscribe to this notification (fall back)

from base
string get_style_class()

Get the CSS style class of the notification

string get_avatar()

Get the user's avatar

string get_reference()

Get the HTML formatted reference of the notification

string get_forum()

Get the forum of the notification reference (fall back)

from base
string get_reason()

Get the reason for the notification

array get_load_special()

Get the special items to load (fall back)

from base
load_special(array $data, array $notifications)

Load the special items (fall back)

from base
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 pre_create_insert_array(array $type_data, array $notify_users)

Pre create insert array function (fall back)

from base
string get_type()

Get notification type name

set_config(config $config)

from pm
set_user_loader(user_loader $user_loader)

from pm
static  get_item_id(array $pm)

Get the id of the

from pm
static int get_item_parent_id(array $pm)

Get the id of the parent

array find_users_for_notification(array $post, array $options = array())

Find the users who want to receive notifications (copied from postinqueue)

string get_title()

Get the HTML formatted title of this notification

string|bool get_email_template()

Get email template

array get_email_template_variables()

Get email template variables

string get_url()

Get the url to this item

array users_to_query()

Users needed to query before this notification can be displayed

Details

in base at line 87
public __construct(driver_interface $db, language $language, user $user, auth $auth, string $phpbb_root_path, string $php_ext, string $user_notifications_table)

Notification Type Base Constructor

Parameters

driver_interface $db
language $language
user $user
auth $auth
string $phpbb_root_path
string $php_ext
string $user_notifications_table

in base at line 105
public set_notification_manager(manager $notification_manager)

Set notification manager (required)

Parameters

manager $notification_manager

in base at line 117
public set_initial_data(array $data = array())

Set initial data from the database

Parameters

array $data Row directly from the database

in base at line 130
public mixed __get(mixed $name)

Magic method to get data from this notification

Parameters

mixed $name

Return Value

mixed

in base at line 144
public null __set(mixed $name, mixed $value)

Magic method to set data on this notification

Parameters

mixed $name
mixed $value

Return Value

null

in base at line 157
public mixed __toString()

Magic method to get a string of this notification

Primarily for testing

Return Value

mixed

at line 245
public create_insert_array($post, array $pre_create_data = array())

Function for preparing the data for insertion in an SQL query

Parameters

$post
array $pre_create_data Data from precreateinsert_array()

in base at line 206
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

in base at line 222
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

in base at line 244
public string|null 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|null If $return is False, nothing will be returned, else the sql code to update this item

in base at line 255
public string|null 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|null If $return is False, nothing will be returned, else the sql code to update this item

in base at line 263
public string get_redirect_url()

{inheritDoc}

Return Value

string URL

in base at line 273
public array prepare_for_display()

Prepare to output the notification to the template

Return Value

array Template variables

in base at line 313
public false get_unsubscribe_url(string|bool $method = false)

URL to unsubscribe to this notification (fall back)

Parameters

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

Return Value

false

at line 38
public string get_style_class()

Get the CSS style class of the notification

Return Value

string

at line 227
public string get_avatar()

Get the user's avatar

Return Value

string

at line 187
public string get_reference()

Get the HTML formatted reference of the notification

Return Value

string

in base at line 353
public string get_forum()

Get the forum of the notification reference (fall back)

Return Value

string

at line 200
public string get_reason()

Get the reason for the notification

Return Value

string

in base at line 373
public array get_load_special()

Get the special items to load (fall back)

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

in base at line 384
public load_special(array $data, array $notifications)

Load the special items (fall back)

Parameters

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

at line 85
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

in base at line 406
public array pre_create_insert_array(array $type_data, array $notify_users)

Pre create insert array function (fall back)

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 28
public string get_type()

Get notification type name

Return Value

string

in pm at line 49
public set_config(config $config)

Parameters

config $config

in pm at line 54
public set_user_loader(user_loader $user_loader)

Parameters

user_loader $user_loader

in pm at line 72
static public get_item_id(array $pm)

Get the id of the

Parameters

array $pm The data from the private message

at line 75
static public int get_item_parent_id(array $pm)

Get the id of the parent

Parameters

array $pm The data from the pm

Return Value

int The report id

at line 102
public array find_users_for_notification(array $post, array $options = array())

Find the users who want to receive notifications (copied from postinqueue)

Parameters

array $post Data from the post
array $options Options for finding users for notification

Return Value

array

at line 170
public string get_title()

Get the HTML formatted title of this notification

Return Value

string

at line 133
public string|bool get_email_template()

Get email template

Return Value

string|bool

at line 143
public array get_email_template_variables()

Get email template variables

Return Value

array

at line 160
public string get_url()

Get the url to this item

Return Value

string URL

at line 237
public array users_to_query()

Users needed to query before this notification can be displayed

Return Value

array Array of user_ids