# Class Database

This class represents a Database in the Rackspace "Red Dwarf" database-as-a-service product.

  OpenCloud\Common\Base
  OpenCloud\Common\Resource\BaseResource
  OpenCloud\Common\Resource\PersistentResource
  OpenCloud\Database\Resource\Database

Namespace: OpenCloud\Database\Resource
Located at OpenCloud/Database/Resource/Database.php

Methods summary
`public` | # `__construct( `OpenCloud\Database\Resource\Instance` $instance, mixed $info = null )` #### Parameters $instance `ServiceInterface` $service The service that this resource belongs to $info `mixed` $data $data #### Overrides `OpenCloud\Common\Resource\BaseResource::__construct()`
`public type` | # `getName( )` Returns name of this database. Because it's so important (i.e. as an identifier), it will throw an error if not set/empty. Returns name of this database. Because it's so important (i.e. as an identifier), it will throw an error if not set/empty. #### Returns `type` #### Throws ``OpenCloud\Common\Exceptions\DatabaseNameError``
`public string` | # `primaryKeyField( )` Returns the primary key field for the object Returns the primary key field for the object #### Returns `string` #### Overrides `OpenCloud\Common\Resource\BaseResource::primaryKeyField()`
`public `OpenCloud\Database\Resource\Instance`` | # `instance( )` Returns the Instance of the database Returns the Instance of the database #### Returns ``OpenCloud\Database\Resource\Instance``
`public OpenCloud\HttpResponse` | # `create( array $params = array() )` Creates a new database Creates a new database #### Parameters $params `array` $params array of attributes to set prior to Create #### Returns `OpenCloud\HttpResponse` #### Api #### Overrides `OpenCloud\Common\Resource\PersistentResource::create()`
`public` | # `update( array $params = array() )` Updates an existing database Updates an existing database #### Parameters $params `array` $params ignored #### Throws `DatabaseUpdateError` always; updates are not permitted #### Overrides `OpenCloud\Common\Resource\PersistentResource::update()`
`protected object` | # `createJson( array $params = array() )` Returns the JSON object for creating the database Returns the JSON object for creating the database #### Returns `object` #### Throws ``RuntimeException`` #### Overrides `OpenCloud\Common\Resource\PersistentResource::createJson()`

Methods inherited from OpenCloud\Common\Resource\PersistentResource
`checkExtension(), delete(), getAlias(), noCreate(), noDelete(), noUpdate(), refresh(), refreshFromLocationUrl(), updateJson(), waitFor()`

Methods inherited from OpenCloud\Common\Resource\BaseResource
`findLink(), getClient(), getMetadata(), getParent(), getService(), getUrl(), jsonCollectionElement(), jsonCollectionName(), jsonName(), parseResponse(), resourceName(), setMetadata(), setParent(), setService()`

Methods inherited from OpenCloud\Common\Base
`__call(), checkJsonError(), generateUuid(), getInstance(), getJsonHeader(), getLogger(), getProperty(), makeResourceIteratorOptions(), populate(), propertyExists(), setLogger(), setProperty(), stripNamespace(), toCamel(), toUnderscores()`

Properties summary
`public string` | $name | `` | #
`protected static string` | $json_collection_name | `'databases'` | #
`protected static string` | $url_resource | `'databases'` | #

Properties inherited from OpenCloud\Common\Resource\BaseResource
`$metadata, $parent, $service`

Properties inherited from OpenCloud\Common\Base
`$aliases`