Announcement
in package
Uses
UtilsProvider
Represent an announcement model.
Table of Contents
Constants
- VISIBILITY_GLOBAL = 'global'
- VISIBILITY_LOCAL = 'local'
Properties
- $data : array<string|int, mixed>
- Additional data, not yet in use.
- $dismissible : bool
- Can the notice be dismissed?
- $graphicFileLink : string
- Link for graphic file, can be `null`.
- $graphicUrl : string
- Full URL to graphic file, can be `null`.
- $graphicUrlRetina : string
- Full URL to retina graphic file, can be `null`.
- $id : int
- ID.
- $pool : AnnouncementPool
- Announcement pool instance.
- $severity : string
- Severity of the notice, can be `warning|info|success|error`.
- $text : string
- Text, can be `null`.
- $title : string
- Title, can be `null`.
- $visibility : string
- Visibility, can be `global|local`.
Methods
- fromResponse() : mixed
- New instance.
- getData() : mixed
- Self-explanatory.
- getGraphicFileLink() : mixed
- Self-explanatory.
- getGraphicUrl() : mixed
- Self-explanatory.
- getGraphicUrlRetina() : mixed
- Self-explanatory.
- getId() : mixed
- Self-explanatory.
- getPluginConstantPrefix() : string
- Get the prefix of this package so we can utils package natively.
- getPool() : mixed
- Self-explanatory.
- getProduct() : mixed
- Self-explanatory.
- getProductVariant() : mixed
- Self-explanatory.
- getSeverity() : mixed
- Self-explanatory.
- getText() : mixed
- Self-explanatory.
- getTitle() : mixed
- Self-explanatory.
- getVisibility() : mixed
- Self-explanatory.
- isDismissed() : mixed
- Check if this announcement is already dismissed and should no longer be visible.
- isDismissible() : mixed
- Self-explanatory.
- isVisible() : mixed
- Determine if notice is visible on current page.
- setupConstants() : mixed
- Make sure the RPM_WP_CLIENT constants are available.
- __construct() : mixed
- C'tor.
Constants
VISIBILITY_GLOBAL
public
mixed
VISIBILITY_GLOBAL
= 'global'
VISIBILITY_LOCAL
public
mixed
VISIBILITY_LOCAL
= 'local'
Properties
$data
Additional data, not yet in use.
private
array<string|int, mixed>
$data
$dismissible
Can the notice be dismissed?
private
bool
$dismissible
Tags
$graphicFileLink
Link for graphic file, can be `null`.
private
string
$graphicFileLink
$graphicUrl
Full URL to graphic file, can be `null`.
private
string
$graphicUrl
$graphicUrlRetina
Full URL to retina graphic file, can be `null`.
private
string
$graphicUrlRetina
$id
ID.
private
int
$id
$pool
Announcement pool instance.
private
AnnouncementPool
$pool
$severity
Severity of the notice, can be `warning|info|success|error`.
private
string
$severity
Tags
$text
Text, can be `null`.
private
string
$text
$title
Title, can be `null`.
private
string
$title
$visibility
Visibility, can be `global|local`.
private
string
$visibility
Tags
Methods
fromResponse()
New instance.
public
static fromResponse(AnnouncementPool $pool, array<string|int, mixed> $response) : mixed
Parameters
- $pool : AnnouncementPool
-
The associated pool to all announcements
- $response : array<string|int, mixed>
-
An item from the official REST API response
Tags
getData()
Self-explanatory.
public
getData() : mixed
Tags
getGraphicFileLink()
Self-explanatory.
public
getGraphicFileLink() : mixed
Tags
getGraphicUrl()
Self-explanatory.
public
getGraphicUrl() : mixed
Tags
getGraphicUrlRetina()
Self-explanatory.
public
getGraphicUrlRetina() : mixed
Tags
getId()
Self-explanatory.
public
getId() : mixed
Tags
getPluginConstantPrefix()
Get the prefix of this package so we can utils package natively.
public
getPluginConstantPrefix() : string
Return values
stringgetPool()
Self-explanatory.
public
getPool() : mixed
Tags
getProduct()
Self-explanatory.
public
getProduct() : mixed
getProductVariant()
Self-explanatory.
public
getProductVariant() : mixed
getSeverity()
Self-explanatory.
public
getSeverity() : mixed
Tags
getText()
Self-explanatory.
public
getText() : mixed
Tags
getTitle()
Self-explanatory.
public
getTitle() : mixed
Tags
getVisibility()
Self-explanatory.
public
getVisibility() : mixed
Tags
isDismissed()
Check if this announcement is already dismissed and should no longer be visible.
public
isDismissed() : mixed
isDismissible()
Self-explanatory.
public
isDismissible() : mixed
Tags
isVisible()
Determine if notice is visible on current page.
public
isVisible() : mixed
setupConstants()
Make sure the RPM_WP_CLIENT constants are available.
public
static setupConstants() : mixed
__construct()
C'tor.
private
__construct(AnnouncementPool $pool, string $id[, string $graphicUrl = null ][, string $graphicUrlRetina = null ][, string $graphicFileLink = null ][, string $title = null ][, string $text = null ][, string $dismissible = true ][, string $data = [] ][, string $severity = 'info' ][, string $visibility = 'local' ]) : mixed
Parameters
- $pool : AnnouncementPool
- $id : string
- $graphicUrl : string = null
- $graphicUrlRetina : string = null
- $graphicFileLink : string = null
- $title : string = null
- $text : string = null
- $dismissible : string = true
- $data : string = []
- $severity : string = 'info'
- $visibility : string = 'local'