Documentation

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
default

true

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

$severity

Severity of the notice, can be `warning|info|success|error`.

private string $severity
Tags
default

info

$visibility

Visibility, can be `global|local`.

private string $visibility
Tags
default

local

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
codeCoverageIgnore

getData()

Self-explanatory.

public getData() : mixed
Tags
codeCoverageIgnore

Self-explanatory.

public getGraphicFileLink() : mixed
Tags
codeCoverageIgnore

getGraphicUrl()

Self-explanatory.

public getGraphicUrl() : mixed
Tags
codeCoverageIgnore

getGraphicUrlRetina()

Self-explanatory.

public getGraphicUrlRetina() : mixed
Tags
codeCoverageIgnore

getId()

Self-explanatory.

public getId() : mixed
Tags
codeCoverageIgnore

getPluginConstantPrefix()

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

public getPluginConstantPrefix() : string
Return values
string

getPool()

Self-explanatory.

public getPool() : mixed
Tags
codeCoverageIgnore

getProduct()

Self-explanatory.

public getProduct() : mixed

getProductVariant()

Self-explanatory.

public getProductVariant() : mixed

getSeverity()

Self-explanatory.

public getSeverity() : mixed
Tags
codeCoverageIgnore

getText()

Self-explanatory.

public getText() : mixed
Tags
codeCoverageIgnore

getTitle()

Self-explanatory.

public getTitle() : mixed
Tags
codeCoverageIgnore

getVisibility()

Self-explanatory.

public getVisibility() : mixed
Tags
codeCoverageIgnore

isDismissed()

Check if this announcement is already dismissed and should no longer be visible.

public isDismissed() : mixed

isDismissible()

Self-explanatory.

public isDismissible() : mixed
Tags
codeCoverageIgnore

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'
Tags
codeCoverageIgnore

        
On this page

Search results