OpenCloud/Database/User.php

Properties

Description

A Database user

Classes

User

Properties

 
 
No 
No 

Description

This class represents a User in the Rackspace "Red Dwarf" database-as-a-service product.
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.

Methods

AddDatabase, Create, CreateJson, Delete, Instance, Service, Update, Url, __construct,

AddDatabase( string   $dbname, ) : void

Description

Adds a new database to the list of databases for the user

Arguments

Name Type Description Default
$dbname string

the database name to be added

Return value

Type Description
void

Tags

Name Description
api

Create( array   $params = array(), ) : \OpenCloud\HttpResponse

Description

Creates a new database user

Arguments

Name Type Description Default
$params array

an associative array of parameters

array()

Return value

Type Description
\OpenCloud\HttpResponse

Tags

Name Description
api
throws if the user's name is not defined
throws if the HTTP status is not Success

CreateJson( ) : n/a

Description

Creates the JSON object for the Create method

Return value

Type Description
n/a n/a

Delete( ) : \OpenCloud\HttpResponse

Description

Deletes a database user

Return value

Type Description
\OpenCloud\HttpResponse

Tags

Name Description
api
throws if HTTP response is not Success

Instance( ) : \OpenCloud\Database\Instance

Description

Returns the Instance of the User

Return value

Type Description
\OpenCloud\Database\Instance

Service( ) : \OpenCloud\DbService

Description

Returns the related service

Return value

Type Description
\OpenCloud\DbService

Update( array   $params = array(), ) : n/a

Description

Updates a database user (not currently permitted)

Arguments

Name Type Description Default
$params array

not currently used, but provided for future updates

array()

Return value

Type Description
n/a n/a

Tags

Name Description
throws always; updates are not currently permitted by this service.

Url( string   $subresource = '', ) : string

Description

Returns the Url of the User

Arguments

Name Type Description Default
$subresource string

Not used

''

Return value

Type Description
string

Tags

Name Description
throws if the user name is not set

__construct( \OpenCloud\Database\Instance   $instance, mixed   $info = null, array   $db = array(), ) : void

Description

Creates a new database object
Unlike other objects (Servers, DataObjects, etc.), passing a database name to the constructor does *not* pull information from the database. For example, if you pass an ID to the `Server()` constructor, it will attempt to retrieve the information on that server from the service, and will return an error if it is not found. However, the Cloud Users service does not permit retrieval of information on individual databases (only via Collection), and thus passing in a name via the `$info` parameter only creates an in-memory object that is not necessarily tied to an actual database.

Arguments

Name Type Description Default
$instance \OpenCloud\Database\Instance

the parent DbService\Instance of the database

$info mixed

if an array or object, treated as properties to set; if a string, treated as the database name

null
$db array

a list of database names to associate with the User

array()

Return value

Type Description
void

Tags

Name Description
throws if `$info` is not a string, object, or array

Properties

$_instance, $databases, $name, $password,

  private  $_instance =




  public  $databases = array()




string  public  $name =

the user name




  public  $password =




Documentation was generated by phpDocumentor 2.0.0b6 .

Namespaces

Packages