Overview

Namespaces

  • None
  • OpenCloud
    • Autoscale
      • Resource
    • CloudMonitoring
      • Exception
      • Resource
    • Common
      • Exceptions
      • Log
      • Request
        • Response
    • Compute
    • Database
    • DNS
    • LoadBalancer
      • Resources
    • ObjectStore
      • Resource
    • Orchestration
    • Volume
  • PHP

Classes

  • Base
  • Collection
  • Lang
  • Metadata
  • Nova
  • PersistentObject
  • Service
  • ServiceCatalogItem
  • Overview
  • Namespace
  • Class
  • Tree
  • Download

Class Base

The root class for all other objects used or defined by this SDK.

It contains common code for error handling as well as service functions that are useful. Because it is an abstract class, it cannot be called directly, and it has no publicly-visible properties.

Direct known subclasses

OpenCloud\Common\Collection, OpenCloud\Common\Metadata, OpenCloud\Common\PersistentObject, OpenCloud\Common\Request\Curl, OpenCloud\Common\Request\Response\Http, OpenCloud\Common\Service, OpenCloud\ObjectStore\Resource\AbstractStorageObject, OpenCloud\OpenStack

Indirect known subclasses

OpenCloud\Autoscale\Resource\AbstractResource, OpenCloud\Autoscale\Resource\Group, OpenCloud\CloudMonitoring\Resource\Alarm, OpenCloud\CloudMonitoring\Resource\Check, OpenCloud\CloudMonitoring\Resource\Entity, OpenCloud\CloudMonitoring\Resource\Notification, OpenCloud\CloudMonitoring\Resource\NotificationPlan, OpenCloud\CloudMonitoring\Resource\ReadonlyResource, OpenCloud\CloudMonitoring\Service, OpenCloud\Common\Nova, OpenCloud\Common\Request\Response\Blank, OpenCloud\Compute\Flavor, OpenCloud\Autoscale\Resource\GroupConfiguration, OpenCloud\Compute\Image, OpenCloud\Compute\Network, OpenCloud\Compute\Server, OpenCloud\Compute\ServerMetadata, OpenCloud\Compute\Service, OpenCloud\Compute\VolumeAttachment, OpenCloud\Database\Database, OpenCloud\Database\Instance, OpenCloud\Database\Service, OpenCloud\Database\User, OpenCloud\Autoscale\Resource\LaunchConfiguration, OpenCloud\DNS\AsyncResponse, OpenCloud\DNS\Domain, OpenCloud\DNS\Object, OpenCloud\DNS\PtrRecord, OpenCloud\DNS\Record, OpenCloud\DNS\Service, OpenCloud\DNS\Subdomain, OpenCloud\LoadBalancer\Resources\Access, OpenCloud\LoadBalancer\Resources\Algorithm, OpenCloud\LoadBalancer\Resources\ConnectionLogging, OpenCloud\Autoscale\Resource\ScalingPolicy, OpenCloud\LoadBalancer\Resources\ConnectionThrottle, OpenCloud\LoadBalancer\Resources\ContentCaching, OpenCloud\LoadBalancer\Resources\ErrorPage, OpenCloud\LoadBalancer\Resources\HealthMonitor, OpenCloud\LoadBalancer\Resources\LoadBalancer, OpenCloud\LoadBalancer\Resources\Metadata, OpenCloud\LoadBalancer\Resources\Node, OpenCloud\LoadBalancer\Resources\NodeEvent, OpenCloud\LoadBalancer\Resources\Readonly, OpenCloud\LoadBalancer\Resources\SessionPersistence, OpenCloud\Autoscale\Resource\Webhook, OpenCloud\LoadBalancer\Resources\SSLTermination, OpenCloud\LoadBalancer\Resources\Stats, OpenCloud\LoadBalancer\Resources\SubResource, OpenCloud\LoadBalancer\Resources\Usage, OpenCloud\LoadBalancer\Resources\VirtualIp, OpenCloud\LoadBalancer\Service, OpenCloud\ObjectStore\AbstractService, OpenCloud\ObjectStore\CDNService, OpenCloud\ObjectStore\Resource\CDNContainer, OpenCloud\ObjectStore\Resource\Container, OpenCloud\Autoscale\Service, OpenCloud\ObjectStore\Resource\DataObject, OpenCloud\ObjectStore\Service, OpenCloud\Orchestration\Service, OpenCloud\Rackspace, OpenCloud\Volume\Service, OpenCloud\Volume\Snapshot, OpenCloud\Volume\Volume, OpenCloud\Volume\VolumeType, OpenCloud\CloudMonitoring\Resource\AbstractResource, OpenCloud\CloudMonitoring\Resource\Account, OpenCloud\CloudMonitoring\Resource\AgentToken
Abstract
Namespace: OpenCloud\Common
Located at OpenCloud/Common/Base.php
Methods summary
public
# setLogger( OpenCloud\Common\Log\LoggerInterface $logger )

Sets the Logger object.

Sets the Logger object.

Parameters

$logger
OpenCloud\Common\Log\LoggerInterface
$logger
public OpenCloud\Common\Log\AbstractLogger
# getLogger( )

Returns the Logger object.

Returns the Logger object.

Returns

OpenCloud\Common\Log\AbstractLogger
public
# url( mixed $subresource = '' )

Returns the URL of the service/object

Returns the URL of the service/object

The assumption is that nearly all objects will have a URL; at this base level, it simply throws an exception to enforce the idea that subclasses need to define this method.

Throws

OpenCloud\Common\Exceptions\UrlError
public
# populate( array|object|string|integer $info, mixed $setObjects = true )

Populates the current object based on an unknown data type.

Populates the current object based on an unknown data type.

Parameters

$info
array|object|string|integer
$info
$setObjects

Throws

OpenCloud\Common\Exceptions\InvalidArgumentError
public
# __set( string $property, mixed $value )

Sets extended attributes on an object and validates them

Sets extended attributes on an object and validates them

This function is provided to ensure that attributes cannot arbitrarily added to an object. If this function is called, it means that the attribute is not defined on the object, and thus an exception is thrown.

Parameters

$property
string
$property the name of the attribute
$value
mixed
$value the value of the attribute

CodeCoverageIgnore

public
# setProperty( string $property, mixed $value, array $prefixes = array() )

Sets an extended (unrecognized) property on the current object

Sets an extended (unrecognized) property on the current object

If RAXSDK_STRICT_PROPERTY_CHECKS is TRUE, then the prefix of the property name must appear in the $prefixes array, or else an exception is thrown.

Parameters

$property
string
$property the property name
$value
mixed
$value the value of the property
$prefixes
array
$prefixes optional list of supported prefixes

Throws

OpenCloud\AttributeError
if strict checks are on and the property prefix is not in the list of prefixes.
public string
# makeQueryString( array $array )

Converts an array of key/value pairs into a single query string

Converts an array of key/value pairs into a single query string

For example, array('A'=>1,'B'=>2) would become 'A=1&B=2'.

Parameters

$array
array
$arr array of key/value pairs

Returns

string
public boolean
# checkJsonError( )

Checks the most recent JSON operation for errors

Checks the most recent JSON operation for errors

This function should be called after any json_*() function call. This ensures that nasty JSON errors are detected and the proper exception thrown.

Example: $obj = json_decode($string); if (check_json_error()) do something ...

Returns

boolean
TRUE if an error occurred, FALSE if none

Throws

OpenCloud\Common\Exceptions\JsonError

CodeCoverageIgnore

public
# getHttpRequestObject( mixed $url, mixed $method = 'GET', array $options = array() )

Returns a class that implements the HttpRequest interface.

Returns a class that implements the HttpRequest interface.

This can be stubbed out for unit testing and avoid making live calls.

PHP OpenCloud API API documentation generated by ApiGen 2.8.0