Base
in package
The root class for all other objects used or defined by this SDK.
It contains common code for error handling as well as service functions that are useful. Because it is an abstract class, it cannot be called directly, and it has no publicly-visible properties.
Table of Contents
- PATCH_CONTENT_TYPE = OpenCloudCommonConstantsMime::JSON_PATCH
- $aliases : array<string|int, mixed>
- The aliases configure for the properties of the instance.
- $logger : LoggerInterface
- The logger instance
- $properties : array<string|int, mixed>
- Holds all the properties added by overloading.
- __call() : mixed
- Intercept non-existent method calls for dynamic getter/setter functionality.
- checkJsonError() : mixed
- Checks the most recent JSON operation for errors.
- generateUuid() : mixed
- getInstance() : static
- getLogger() : LoggerInterface
- Returns the Logger object.
- hasLogger() : bool
- makeResourceIteratorOptions() : mixed
- populate() : mixed
- Populates the current object based on an unknown data type.
- setLogger() : $this
- Sets the logger.
- stripNamespace() : mixed
- toCamel() : mixed
- Convert a string to camelCase format.
- toUnderscores() : mixed
- Convert string to underscore format.
- url() : mixed
- getJsonHeader() : mixed
- getPatchHeaders() : mixed
- getProperty() : mixed
- Grab value out of the data array.
- propertyExists() : bool
- Basic check to see whether property exists.
- setProperty() : mixed
- We can set a property under three conditions:
- checkAttributePrefix() : bool
- Checks the attribute $property and only permits it if the prefix is in the specified $prefixes array
- isAccessible() : bool
- Does the property exist in the object variable list (i.e. does it have public or protected visibility?)
Constants
PATCH_CONTENT_TYPE
public
mixed
PATCH_CONTENT_TYPE
= OpenCloudCommonConstantsMime::JSON_PATCH
Properties
$aliases
The aliases configure for the properties of the instance.
protected
array<string|int, mixed>
$aliases
= array()
$logger
The logger instance
private
LoggerInterface
$logger
$properties
Holds all the properties added by overloading.
private
array<string|int, mixed>
$properties
= array()
Methods
__call()
Intercept non-existent method calls for dynamic getter/setter functionality.
public
__call( $method, $args) : mixed
Parameters
Tags
Return values
mixed —checkJsonError()
Checks the most recent JSON operation for errors.
public
static checkJsonError() : mixed
Tags
Return values
mixed —generateUuid()
public
static generateUuid() : mixed
Return values
mixed —getInstance()
public
static getInstance() : static
Return values
static —getLogger()
Returns the Logger object.
public
getLogger() : LoggerInterface
Return values
LoggerInterface —hasLogger()
public
hasLogger() : bool
Return values
bool —makeResourceIteratorOptions()
public
makeResourceIteratorOptions(mixed $resource) : mixed
Parameters
- $resource : mixed
Return values
mixed —populate()
Populates the current object based on an unknown data type.
public
populate(mixed $info[, mixed $setObjects = true ]) : mixed
Parameters
- $info : mixed
- $setObjects : mixed = true
Tags
Return values
mixed —setLogger()
Sets the logger.
public
setLogger([LoggerInterface $logger = null ]) : $this
Parameters
- $logger : LoggerInterface = null
Return values
$this —stripNamespace()
public
stripNamespace(mixed $namespace) : mixed
Parameters
- $namespace : mixed
Return values
mixed —toCamel()
Convert a string to camelCase format.
public
toCamel( $string[, bool $capitalise = true ]) : mixed
Parameters
Return values
mixed —toUnderscores()
Convert string to underscore format.
public
toUnderscores( $string) : mixed
Parameters
Return values
mixed —url()
public
url([mixed $path = null ][, array<string|int, mixed> $query = array() ]) : mixed
Parameters
- $path : mixed = null
- $query : array<string|int, mixed> = array()
Tags
Return values
mixed —getJsonHeader()
protected
static getJsonHeader() : mixed
Return values
mixed —getPatchHeaders()
protected
static getPatchHeaders() : mixed
Return values
mixed —getProperty()
Grab value out of the data array.
protected
getProperty(string $property) : mixed
Parameters
- $property : string
Return values
mixed —propertyExists()
Basic check to see whether property exists.
protected
propertyExists(string $property[, bool $allowRetry = true ]) : bool
Parameters
- $property : string
-
The property name being investigated.
- $allowRetry : bool = true
-
If set to TRUE, the check will try to format the name in underscores because there are sometimes discrepancies between camelCaseNames and underscore_names.
Return values
bool —setProperty()
We can set a property under three conditions:
protected
setProperty(mixed $property, mixed $value) : mixed
- If it has a concrete setter: setProperty()
- If the property exists
- If the property name's prefix is in an approved list
Parameters
- $property : mixed
- $value : mixed
Return values
mixed —checkAttributePrefix()
Checks the attribute $property and only permits it if the prefix is in the specified $prefixes array
private
checkAttributePrefix(string $property) : bool
This is to support extension namespaces in some services.
Parameters
- $property : string
-
the name of the attribute
Return values
bool —isAccessible()
Does the property exist in the object variable list (i.e. does it have public or protected visibility?)
private
isAccessible( $property) : bool