pfSense-pkg-RESTAPI

ResourceLinkSet
in package
uses BaseTraits

Defines a class that allows the storage and processing of many ResourceLink objects at once.

Table of Contents

Properties

$rel  : string
$resource_links  : array<string|int, mixed>
$use_namespace  : bool

Methods

__construct()  : mixed
Constructs a new ResourceLinkSet object
get_class_fqn()  : string
Obtains the fully qualified name of the called class.
get_class_shortname()  : string
Obtains the shortname of the called class.
get_classes_in_namespace()  : array<string|int, mixed>
Obtains all classes associated with this class's current namespace.
log_error()  : void
Logs an error to the syslog.
to_representation()  : array<string|int, mixed>
Converts all ResourceLink objects in this ResourceLinkSet into their representation values.

Properties

public array<string|int, mixed> $resource_links = []

Methods

__construct()

Constructs a new ResourceLinkSet object

public __construct([array<string|int, mixed> $resource_links = [] ][, string $rel = '_links' ][, bool $use_namespace = false ]) : mixed
Parameters
$resource_links : array<string|int, mixed> = []

An array of ResourceLink objects to include in this ResourceLinkSet

$rel : string = '_links'

The HAL related resource name for this ResourceLinkSet. This allows many ResourceLink objects to represented under a single related resource name. If a value is specified here, this ResourceLinkSet is expected to be nested within a root ResourceLinkSet that does not have this value defined.

$use_namespace : bool = false

Set to true to prefix the HAL namespace for this package to the $rel value or set to false to use the $rel value directly. Unless $rel is a standard HAL related resource name, this should be set to true.

get_class_fqn()

Obtains the fully qualified name of the called class.

public get_class_fqn() : string
Return values
string

The FQN for this object's class.

get_class_shortname()

Obtains the shortname of the called class.

public get_class_shortname() : string
Return values
string

The shortname for this object's class.

get_classes_in_namespace()

Obtains all classes associated with this class's current namespace.

public get_classes_in_namespace([bool $shortnames = false ]) : array<string|int, mixed>
Parameters
$shortnames : bool = false
Return values
array<string|int, mixed>

An array of classes currently in this object's namespace

log_error()

Logs an error to the syslog.

public static log_error(string $message) : void
Parameters
$message : string

The error message to write to the syslog

to_representation()

Converts all ResourceLink objects in this ResourceLinkSet into their representation values.

public to_representation() : array<string|int, mixed>
Tags
returns

array An array representation of each HAL ResourceLink object nested under the HAL standard _links array key.

Return values
array<string|int, mixed>

        
On this page

Search results