abstract class base implements feed_interface

Base class with some generic functions and settings.

Properties

protected helper $helper

Feed helper object

protected config $config
protected driver_interface $db
protected driver_interface $cache
protected user $user
protected auth $auth
protected content_visibility $content_visibility
protected dispatcher_interface $phpbb_dispatcher
protected string $phpEx
protected $sql

SQL Query to be executed to get feed items

protected $keys

Keys specified for retrieval of title, content, etc.

protected $num_items

Number of items to fetch. Usually overwritten by $config['feed_something']

protected $separator

Separator for title elements to separate items (for example forum / topic)

protected $separator_stats

Separator for the statistics row (Posted by, post date, replies, etc.)

protected mixed $result

Methods

__construct(helper $helper, config $config, driver_interface $db, driver_interface $cache, user $user, auth $auth, content_visibility $content_visibility, dispatcher_interface $phpbb_dispatcher, string $phpEx)

Constructor

set_keys()

Set keys.

open()

Open feed

close()

Close feed

set(string $key, mixed $value)

Set key

mixed
get(string $key)

Get key

array
get_item()

Get the next post in the feed

int[]
get_readable_forums()

Returns the ids of the forums readable by the current user.

int[]
get_moderator_approve_forums()

Returns the ids of the forum for which the current user can approve the post in the moderation queue.

bool
is_moderator_approve_forum(int $forum_id)

Returns true if the current user can approve the post of the given forum

int[]
get_excluded_forums()

Returns the ids of the forum excluded from the feeds

bool
is_excluded_forum(int $forum_id)

Returns true if the given id is in the excluded forums list.

array
get_passworded_forums()

Returns all password protected forum ids the current user is currently NOT authenticated for.

string
user_viewprofile($row)

Returns the link to the user profile.

string
get_sql()

Returns the SQL query used to retrieve the posts of the feed.

Details

at line 92
__construct(helper $helper, config $config, driver_interface $db, driver_interface $cache, user $user, auth $auth, content_visibility $content_visibility, dispatcher_interface $phpbb_dispatcher, string $phpEx)

Constructor

Parameters

helper $helper

Feed helper

config $config

Config object

driver_interface $db

Database connection

driver_interface $cache

Cache object

user $user

User object

auth $auth

Auth object

content_visibility $content_visibility

Auth object

dispatcher_interface $phpbb_dispatcher

Event dispatcher object

string $phpEx

php file extension

at line 132
set_keys()

Set keys.

at line 139
open()

Open feed

at line 146
close()

Close feed

at line 157
set(string $key, mixed $value)

Set key

Parameters

string $key Key
mixed $value Value

at line 165
mixed get(string $key)

Get key

Parameters

string $key Key

Return Value

mixed

at line 173
array get_item()

Get the next post in the feed

Return Value

array

at line 210
protected int[] get_readable_forums()

Returns the ids of the forums readable by the current user.

Return Value

int[]

at line 227
protected int[] get_moderator_approve_forums()

Returns the ids of the forum for which the current user can approve the post in the moderation queue.

Return Value

int[]

at line 245
protected bool is_moderator_approve_forum(int $forum_id)

Returns true if the current user can approve the post of the given forum

Parameters

int $forum_id

Forum id to check

Return Value

bool

at line 262
protected int[] get_excluded_forums()

Returns the ids of the forum excluded from the feeds

Return Value

int[]

at line 295
protected bool is_excluded_forum(int $forum_id)

Returns true if the given id is in the excluded forums list.

Parameters

int $forum_id

Id to check

Return Value

bool

at line 307
protected array get_passworded_forums()

Returns all password protected forum ids the current user is currently NOT authenticated for.

Return Value

array

Array of forum ids

at line 317
protected string user_viewprofile($row)

Returns the link to the user profile.

Parameters

$row

Return Value

string

at line 336
abstract protected string get_sql()

Returns the SQL query used to retrieve the posts of the feed.

Return Value

string

SQL SELECT query