Metadata

The Metadata Helper gives you the ability to manipulate metadata on vCloud objects with ease. It helps finding objects with a particular metadata (to either one particular value, or any value).

Methods

Create a new Metadata Helper

__construct(\VMware_VCloud_SDK_Service $service) 

Arguments

$service

\VMware_VCloud_SDK_Service

The vCloud Director SDK Service

Create a new Metadata Helper and returns it without modifications. This form allow chaining in ALL versions of PHP:

create(\VMware_VCloud_SDK_Service $service) : \VCloud\Helpers\Metadata
static

\VCloud\Helpers\Metadata::create($service)->queryRecords(...)

Since PHP 5.4, Class member access on instantiation is allowed:

new (\VCloud\Helpers\Metadata($service))->queryRecords(...)

Arguments

$service

\VMware_VCloud_SDK_Service

The vCloud Director SDK Service

Response

\VCloud\Helpers\Metadata

Returns a new Metadata Handler

Determine whether a metadata entry has a given name, and optionally, a given value.

doesEntryMatch(\VMware_VCloud_API_MetadataEntryType $entry, string $metadataName, string $metadataValue = null) : boolean
static

Arguments

$entry

\VMware_VCloud_API_MetadataEntryType

The metadata entry to test

$metadataName

string

The expected name

$metadataValue

string

The expected value (optional)

Response

boolean

Returns true if the entry has the expected name (and the expected value, if given)

Determine whether a vCloud object contains a metadata having a given name, and optionally, a given value.

doesObjectMatch(mixed $object, string $metadataName, string $metadataValue) : boolean
static

Arguments

$object

mixed

The vCloud object to test

$metadataName

string

The expected name

$metadataValue

string

The expected value (optional)

Response

boolean

Returns true if the object contains a metadata with the expected name (and the expected value, if given)

Get all object of a given type containing a metadata having a given name, and optionally, a given value.

getObjects(string $type, string $metadataName, string $metadataValue = null) : array

Arguments

$type

string

The expected query type, see Query helper

$metadataName

string

The expected name

$metadataValue

string

The expected value (optional)

Response

array

Returns all objects containing a metadata with the expected name (and the expected value, if given)

Get the first object of a given type containing a metadata having a given name, and optionally, a given value.

getObject(string $type, string $metadataName, string $metadataValue = null) : mixed

Arguments

$type

string

The expected query type, see Query helper

$metadataName

string

The expected name

$metadataValue

string

The expected value (optional)

Response

mixed

Returns the first objects containing a metadata with the expected name (and the expected value, if given)

Properties

vCloud Director SDK Service

service : \VMware_VCloud_SDK_Service
var

vCloud Director SDK Service

Type(s)

\VMware_VCloud_SDK_Service