class report_post_closed extends post

Post report closed notifications class This class handles notifications for when reports are closed on posts (for the one who reported the post)

Properties

protected manager $notification_manager from  base
protected driver_interface $db from  base
protected language $language from  base
protected user $user from  base
protected auth $auth from  base
protected string $phpbb_root_path from  base
protected string $php_ext from  base
protected string $user_notifications_table from  base
static bool|array $notification_option

Notification option data (for outputting to the user)

protected int $notification_type_id

The notification_type_id, set upon creation of the class This is the notification_type_id from the notification_types table

from  base
protected string $language_key

Language key used to output the text

protected bool $inherit_read_status

Inherit notification read status from post.

protected user_loader $user_loader from  post
protected config $config from  post
string $email_template

Email template to use to send notifications

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
void
__set(mixed $name, mixed $value)

Magic method to set data on this notification

from  base
bool
__isset(mixed $name)

Magic method check if a variable is defined and is not null

from  base
mixed
__toString()

Magic method to get a string of this notification

from  base
mixed
get_data(string|false $name)

Get special data (only important for the classes that extend this)

from  base
set_data(string $name, mixed $value)

Set special data (only important for the classes that extend this)

from  base
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)

from  base
string
mark_read(bool $return = false)

Mark this item read

from  base
string
mark_unread(bool $return = false)

Mark this item unread

from  base
string
get_redirect_url()

{inheritDoc}

prepare_for_display()

Prepare to output the notification to the template

from  base
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 (fall back)

from  base
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 (fall back)

from  base
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 available

string|bool
get_email_template()

Get email template

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 create_insert_array() is run. The data returned from this function will be sent to create_insert_array().

from  post
array
check_user_notification_options(array|bool $user_ids = false, array $options = array())

Find the users who want to receive notifications (helper)

from  base
string|null
mark(bool $unread = true, bool $return = false)

Mark this item read/unread helper

from  base
array
get_authorised_recipients(array $users, int $forum_id, array $options, bool $sort = false)

Get a list of users that are authorised to receive notifications

from  base
string
get_type()

Get notification type name

set_config(config $config)

No description

from  post
set_user_loader(user_loader $user_loader)

No description

from  post
static 
get_item_id(array $type_data)

Get the id of the item

from  post
static 
get_item_parent_id(array $type_data)

Get the id of the parent

from  post
array
find_users_for_notification(array $type_data, array $options = [])

Find the users who want to receive notifications

string
get_title()

Get the HTML formatted title of this notification

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

array
trim_user_ary(array $users)

Trim the user array passed down to 3 users if the array contains more than 4 users.

from  post
array
add_responders(mixed $post)

Add responders to the notification

from  post

Details

in base at line 87
__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
set_notification_manager(manager $notification_manager)

Set notification manager (required)

Parameters

manager $notification_manager

in base at line 117
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
mixed __get(mixed $name)

Magic method to get data from this notification

Parameters

mixed $name

Return Value

mixed

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

Magic method to set data on this notification

Parameters

mixed $name
mixed $value

Return Value

void

in base at line 156
bool __isset(mixed $name)

Magic method check if a variable is defined and is not null

Parameters

mixed $name

Return Value

bool

in base at line 168
mixed __toString()

Magic method to get a string of this notification

Primarily for testing

Return Value

mixed

in base at line 179
protected mixed get_data(string|false $name)

Get special data (only important for the classes that extend this)

Parameters

string|false $name

Name of the variable to get, false if all data should be returned

Return Value

mixed

in base at line 190
protected set_data(string $name, mixed $value)

Set special data (only important for the classes that extend this)

Parameters

string $name

Name of the variable to set

mixed $value

Value to set to the variable

at line 188
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 pre_create_insert_array()

at line 200
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 232
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 254
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

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

at line 134
string get_redirect_url()

{inheritDoc}

Return Value

string URL

in base at line 283
prepare_for_display()

Prepare to output the notification to the template

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

in base at line 345
string get_style_class()

Get the CSS style class of the notification (fall back)

Return Value

string

at line 170
string get_avatar()

Get the user's avatar

Return Value

string

at line 159
string get_reference()

Get the HTML formatted reference of the notification

Return Value

string

in base at line 375
string get_forum()

Get the forum of the notification reference (fall back)

Return Value

string

in base at line 385
string get_reason()

Get the reason for the notification (fall back)

Return Value

string

in base at line 395
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 406
load_special(array $data, array $notifications)

Load the special items (fall back)

Parameters

array $data

Data from get_load_special()

array $notifications

Array of notifications (key is notification_id, value is the notification objects)

at line 66
bool is_available()

Is available

Return Value

bool

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

at line 96
string|bool get_email_template()

Get email template

Return Value

string|bool

in post at line 347
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 create_insert_array() is run. The data returned from this function will be sent to create_insert_array().

Parameters

array $type_data

The type specific data

array $notify_users

Notify users list Formatted from find_users_for_notification()

Return Value

array

Whatever you want to send to create_insert_array().

in base at line 452
protected array check_user_notification_options(array|bool $user_ids = false, array $options = array())

Find the users who want to receive notifications (helper)

Parameters

array|bool $user_ids

User IDs to check if they want to receive notifications (Bool False to check all users besides anonymous and bots (USER_IGNORE))

array $options

Return Value

array

in base at line 551
protected string|null mark(bool $unread = true, bool $return = false)

Mark this item read/unread helper

Parameters

bool $unread

Unread (True/False) (Default: False)

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 583
protected array get_authorised_recipients(array $users, int $forum_id, array $options, bool $sort = false)

Get a list of users that are authorised to receive notifications

Parameters

array $users

Array of users that have subscribed to a notification

int $forum_id

Forum ID of the forum

array $options

Array of notification options

bool $sort

Whether the users array should be sorted. Default: false

Return Value

array

Array of users that are authorised recipients

at line 28
string get_type()

Get notification type name

Return Value

string

in post at line 64
set_config(config $config)

No description

Parameters

config $config

in post at line 69
set_user_loader(user_loader $user_loader)

No description

Parameters

user_loader $user_loader

in post at line 89
static get_item_id(array $type_data)

Get the id of the item

Parameters

array $type_data

The type specific data

in post at line 101
static get_item_parent_id(array $type_data)

Get the id of the parent

Parameters

array $type_data

The type specific data

at line 79
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 144
string get_title()

Get the HTML formatted title of this notification

Return Value

string

at line 106
array get_email_template_variables()

Get email template variables

Return Value

array

at line 126
string get_url()

Get the url to this item

Return Value

string URL

at line 180
array users_to_query()

Users needed to query before this notification can be displayed

Return Value

array

Array of user_ids

in post at line 326
array trim_user_ary(array $users)

Trim the user array passed down to 3 users if the array contains more than 4 users.

Parameters

array $users

Array of users

Return Value

array

Trimmed array of user_ids

in post at line 403
array add_responders(mixed $post)

Add responders to the notification

Parameters

mixed $post

Return Value

array

Array of responder data