Methods summary
public
|
#
__construct( OpenCloud\Database\Instance $instance, mixed $info = null, array $db = array() )
Creates a new database object
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.
Parameters
- $instance
OpenCloud\Database\Instance
$instance the parent DbService\Instance of the database
- $info
mixed $info if an array or object, treated as properties to set; if a string, treated
as the database name
- $db
array $db a list of database names to associate with the User
Throws
UserNameError if $info is not a string, object, or array
Overrides
|
public
type
|
#
getName( )
Returns name of this user. Because it's so important (i.e. as an identifier),
it will throw an error if not set/empty.
Returns name of this user. Because it's so important (i.e. as an identifier),
it will throw an error if not set/empty.
Returns
type
Throws
|
public
string
|
#
url( string $subresource = '', array $params = array() )
Returns the default URL of the object
Returns the default URL of the object
Parameters
- $subresource
string $subresource optional sub-resource string
- $params
array $qstr optional k/v pairs for query strings
Returns
string
Throws
UrlError if URL is not defined
Overrides
|
public
|
#
addDatabase( string $dbname )
Adds a new database to the list of databases for the user
Adds a new database to the list of databases for the user
Parameters
- $dbname
string $dbname the database name to be added
Api
|
public
string
|
#
createUrl( )
returns the URL used for Create
returns the URL used for Create
Returns
string
Overrides
|
public
HttpResponse
|
#
update( array $params = array() )
Updates an existing object
Updates an existing object
Parameters
- $params
array $params array of values to set when updating the object
Returns
HttpResponse
Throws
VolumeCreateError if HTTP status is not Success
Overrides
|
public
OpenCloud\HttpResponse
|
#
delete( )
Deletes a database user
Returns
OpenCloud\HttpResponse
Throws
UserDeleteError if HTTP response is not Success
Api
Overrides
|
protected
|
#
createJson( )
Returns an object for the Create() method JSON Must be overridden in a child
class.
Returns an object for the Create() method JSON Must be overridden in a child
class.
Throws
CreateError if not overridden
Overrides
|