Overview

Namespaces

  • OpenCloud
    • Autoscale
      • Resource
    • CloudMonitoring
      • Exception
      • Resource
    • Common
      • Collection
      • Constants
      • Exceptions
      • Http
        • Message
      • Log
      • Resource
      • Service
    • Compute
      • Constants
      • Exception
      • Resource
    • Database
      • Resource
    • DNS
      • Collection
      • Resource
    • Identity
      • Constants
      • Resource
    • Image
      • Enum
      • Resource
        • JsonPatch
        • Schema
    • LoadBalancer
      • Enum
      • Resource
    • ObjectStore
      • Constants
      • Exception
      • Resource
      • Upload
    • Orchestration
    • Queues
      • Exception
      • Resource
    • Volume
      • Resource
  • PHP

Classes

  • ArrayAccess
  • Base
  • Lang
  • Metadata
  • Overview
  • Namespace
  • Class
  • Tree
  • Download

Class Metadata

The Metadata class represents either Server or Image metadata

OpenCloud\Common\Base
Extended by OpenCloud\Common\Metadata implements Countable

Direct known subclasses

OpenCloud\Compute\Resource\ServerMetadata, OpenCloud\ObjectStore\Resource\ContainerMetadata
Namespace: OpenCloud\Common
Located at OpenCloud/Common/Metadata.php
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
# __get( mixed $key )
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

OpenCloud\Common\Base::propertyExists()
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

OpenCloud\Common\Base::getProperty()
public mixed
# setProperty( mixed $property, mixed $value )

We can set a property under three conditions:

We can set a property under three conditions:

  1. If it has a concrete setter: setProperty()
  2. If the property exists
  3. If the property name's prefix is in an approved list

Parameters

$property
mixed
$property
$value
mixed
$value

Returns

mixed

Overrides

OpenCloud\Common\Base::setProperty()
public
# __isset( mixed $property )
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
# toArray( )
public
# count( )

Implementation of

Countable::count()
Methods inherited from OpenCloud\Common\Base
__call(), checkJsonError(), generateUuid(), getInstance(), getJsonHeader(), getLogger(), makeResourceIteratorOptions(), populate(), setLogger(), stripNamespace(), toCamel(), toUnderscores()
Properties summary
protected array $metadata array()
#

Internal data store.

Internal data store.

Properties inherited from OpenCloud\Common\Base
$aliases
PHP OpenCloud API API documentation generated by ApiGen 2.8.0