Class Metadata
The Metadata class represents either Server or Image metadata
-
OpenCloud\Common\Base
-
OpenCloud\Common\Metadata
implements
Countable
Methods summary
public
|
#
__set( string $property, string $value )
This setter overrides the base one, since the metadata key can be
anything
This setter overrides the base one, since the metadata key can be
anything
Parameters
- $property
string $property
- $value
string $value
|
public
|
|
public
boolean
|
#
propertyExists( string $property, boolean $allowRetry = true )
Basic check to see whether property exists.
Basic check to see whether property exists.
Parameters
- $property
string $property The property name being investigated.
- $allowRetry
boolean $allowRetry If set to TRUE, the check will try to format the name in underscores
because there are sometimes discrepancies between camelCaseNames and
underscore_names.
Returns
boolean
Overrides
|
public
mixed
|
#
getProperty( string $property )
Grab value out of the data array.
Grab value out of the data array.
Parameters
- $property
string $property
Returns
mixed
Overrides
|
public
mixed
|
#
setProperty( mixed $property, mixed $value )
We can set a property under three conditions:
We can set a property under three conditions:
- 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 $property
- $value
mixed $value
Returns
mixed
Overrides
|
public
|
|
public
array
|
#
keylist( )
Returns the list of keys defined
Returns the list of keys defined
Returns
array
|
public
|
#
setArray( array $values, string $prefix = null )
Sets metadata values from an array, with optional prefix
Sets metadata values from an array, with optional prefix
If $prefix is provided, then only array keys that match the prefix are set as
metadata values, and $prefix is stripped from the key name.
Parameters
- $values
array $values an array of key/value pairs to set
- $prefix
string $prefix if provided, a prefix that is used to identify metadata values. For
example, you can set values from headers for a Container by using
$prefix='X-Container-Meta-'.
|
public
|
|
public
|
|
Methods inherited from OpenCloud\Common\Base
__call(),
checkJsonError(),
generateUuid(),
getInstance(),
getJsonHeader(),
getLogger(),
makeResourceIteratorOptions(),
populate(),
setLogger(),
stripNamespace(),
toCamel(),
toUnderscores()
|
Properties summary
protected
array
|
$metadata
|
array() |
|