OpenCloud/LoadBalancer/Resources/SubResource.php

Classes

SubResource

Properties

 
 
Yes 
No 

Description

SubResource is an abstract class that handles subresources of a LoadBalancer object; for example, the `/loadbalancers/{id}/errorpage`. Since most of the subresources are handled in a similar manner, this consolidates the functions.
There are really four pieces of data that define a subresource: * `$url_resource` - the actual name of the url component * `$json_name` - the name of the JSON object holding the data * `$json_collection_name` - if the collection is not simply `$json_name . 's'`, this defines the collectio name. * `$json_collection_element` - if the object in a collection is not anonymous, this defines the name of the element holding the object. Of these, only the `$json_name` and `$url_resource` are required.

Methods

CreateJson, Name, Parent, UpdateJson, Url, __construct,

CreateJson( ) : \stdClass;

Description

returns the JSON document's object for creating the subresource
The value `$_create_keys` should be an array of names of data items that can be used in the creation of the object.

Return value

Type Description
\stdClass;

Name( ) : string

Description

returns a (default) name of the object
The name is constructed by the object class and the object's ID.

Return value

Type Description
string

Tags

Name Description
api

Parent( ) : mixed

Description

returns the Parent object (usually a LoadBalancer, but sometimes another SubResource)

Return value

Type Description
mixed

UpdateJson(   $params = array(), ) : \stdClass

Description

returns the JSON for the update (same as create)
For these subresources, the update JSON is the same as the Create JSON

Arguments

Name Type Description Default
$params n/a array()

Return value

Type Description
\stdClass

Url( string   $subresource = null, array   $qstr = array(), ) : string

Description

returns the URL of the SubResource

Arguments

Name Type Description Default
$subresource string

the subresource of the parent

null
$qstr array

an array of key/value pairs to be converted to query string parameters for the subresource

array()

Return value

Type Description
string

Tags

Name Description
api

__construct(   $object, mixed   $value = null, ) : n/a

Description

constructs the SubResource's object

Arguments

Name Type Description Default
$object n/a
$value mixed

the ID or array of values for the object

null

Return value

Type Description
n/a n/a

Properties

$parent,

  private  $parent =




Documentation was generated by phpDocumentor 2.0.0b6 .

Namespaces

Packages