Service

The Right Helper provides various helper methods to facilitate using the vCloud Director SDK's service objects.

Methods

Create a new Service Helper

__construct(\VMware_VCloud_SDK_Service $service) : \VCloud\Helpers\Service

Arguments

$service

\VMware_VCloud_SDK_Service

The vCloud Director SDK Service

Response

\VCloud\Helpers\Service

Returns a new Service Handler

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

create(\VMware_VCloud_SDK_Service $service) 
static

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

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

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

Arguments

$service

\VMware_VCloud_SDK_Service

The vCloud Director SDK Service

Create a vCloud SDK for PHP reference

createReference(string $type, string $href, string $name = null) 

Arguments

$type

string

Object type

$href

string

Href of the object

$name

string

Name of the object

Get the UUID from any vCloud Director object. The id is extracted from the href, so the given object must have a `get_href` method.

getId(mixed $object) : string

Arguments

$object

mixed

The source object

Response

string

Returns the given object's UUID

Get the currently logged user's name

getCurrentUserName() : string

Response

string

Returns name as it's returned by vCloud Director (not lowercased neither uppercased).

Get the currently logged user's organization name

getCurrentOrganizationName() : string

Response

string

Returns name as it's returned by vCloud Director (not lowercased neither uppercased).

Get the currently logged user's organization

getCurrentOrganization() : \VMware_VCloud_SDK_AdminOrg

Response

\VMware_VCloud_SDK_AdminOrg

Returns the currently logged user's organization

Get the currently logged user

getCurrentUser() : \VMware_VCloud_SDK_User

Response

\VMware_VCloud_SDK_User

Returns the currently logged user

Constants

PATTERN_UUID

PATTERN_UUID
var

Regular expression to extract UUID from any string

Properties

vCloud Director SDK Service

service : \VMware_VCloud_SDK_Service
var

vCloud Director SDK Service

Type(s)

\VMware_VCloud_SDK_Service