\DevOwl\RealProductManagerWpClient\announcementAnnouncementPool

Represent a set of announcements synced to the backend (for a given plugin update).

A announcement pool is a dependency of the plugin update because they should only be shown, when a valid license is active.

Summary

Methods
Properties
Constants
getPluginConstantPrefix()
setupConstants()
initialize()
sync()
syncViewStatus()
dismiss()
isActive()
getPluginUpdate()
getView()
getOption()
getClient()
getItems()
getViewed()
getDismissed()
instance()
No public properties found
OPTION_NAME
OPTION_EXPIRE
OPTION_NAME_ENABLED
DEFAULT_ENABLED
No protected methods found
No protected properties found
N/A
__construct()
$pluginUpdate
$view
$option
$client
$items
$viewed
$dismissed
N/A

Constants

OPTION_NAME

OPTION_NAME =RPM_WP_CLIENT_OPT_PREFIX . '-announcements'

OPTION_EXPIRE

OPTION_EXPIRE =60 * 60 * 6

OPTION_NAME_ENABLED

OPTION_NAME_ENABLED =RPM_WP_CLIENT_OPT_PREFIX . '-announcements-active_'

DEFAULT_ENABLED

DEFAULT_ENABLED =true

Properties

$option

$option :

Expired option for announcement cache.

Type

$client

$client :

Announcement client.

Type

$viewed

$viewed :array<mixed,integer>

List of all viewed announcement IDs of remote.

Type

array<mixed,integer>

$dismissed

$dismissed :array<mixed,integer>

List of all dismissed announcement IDs of remote.

Type

array<mixed,integer>

Methods

getPluginConstantPrefix()

getPluginConstantPrefix(): string

Get the prefix of this package so we can utils package natively.

Returns

string

setupConstants()

setupConstants()

Make sure the RPM_WP_CLIENT constants are available.

initialize()

initialize()

This function should only be called when a valid license was found. This is before the `init` hook was called!

sync()

sync(boolean  $force = false)

Sync all current available announcements and fetch from remote all x hours.

This method may only be called when the user has a valid license!

Parameters

boolean $force

syncViewStatus()

syncViewStatus(\DevOwl\RealProductManagerWpClient\announcement\Announcement  $announcement)

Sync the view status to the remote server. It automatically uses all valid licenses in a multisite installation.

Parameters

\DevOwl\RealProductManagerWpClient\announcement\Announcement $announcement

dismiss()

dismiss(integer  $id)

Dismiss an announcement by ID.

Parameters

integer $id

Announcement ID

isActive()

isActive(boolean  $set = null)

Check if announcements are currently active (announcements can be disabled by the user).

Parameters

boolean $set

getPluginUpdate()

getPluginUpdate()

Self-explanatory.

getView()

getView()

Self-explanatory.

getOption()

getOption()

Self-explanatory.

getClient()

getClient()

Self-explanatory.

getItems()

getItems()

Self-explanatory.

getViewed()

getViewed()

Self-explanatory.

getDismissed()

getDismissed()

Self-explanatory.