# Class DataObject

Objects are the basic storage entities in Cloud Files. They represent the files and their optional metadata you upload to the system. When you upload objects to Cloud Files, the data is stored as-is (without compression or encryption) and consists of a location (container), the object's name, and any metadata you assign consisting of key/value pairs.

  OpenCloud\Common\Base
  OpenCloud\ObjectStore\Resource\AbstractResource
  OpenCloud\ObjectStore\Resource\DataObject

Namespace: OpenCloud\ObjectStore\Resource
Located at OpenCloud/ObjectStore/Resource/DataObject.php

Methods summary
`public` | # `__construct( `OpenCloud\ObjectStore\Resource\Container` $container, null $data = null )` Also need to set Container parent and handle pseudo-directories. Also need to set Container parent and handle pseudo-directories. #### Parameters $container ``OpenCloud\ObjectStore\Resource\Container`` $container $data `null` $data #### Overrides `OpenCloud\ObjectStore\Resource\AbstractResource::__construct()`
`public` | # `populate( mixed $info, boolean $setObjects = true )` A collection list of DataObjects contains a different data structure than the one returned for the "Retrieve Object" operation. So we need to stock the values differently. Populates the current object based on an unknown data type. A collection list of DataObjects contains a different data structure than the one returned for the "Retrieve Object" operation. So we need to stock the values differently. Populates the current object based on an unknown data type. #### Parameters $info `mixed` $info $setObjects `boolean` #### Throws ``OpenCloud\Common\Exceptions\InvalidArgumentError`` #### Overrides `OpenCloud\Common\Base::populate()`
`public mixed` | # `populateFromResponse( Guzzle\Http\Message\Response $response )` Takes a response and stocks common values from both the body and the headers. Takes a response and stocks common values from both the body and the headers. #### Parameters $response `Guzzle\Http\Message\Response` $response #### Returns `mixed` $this
`public` | # `refresh( )`
`public mixed` | # `setContainer( `OpenCloud\ObjectStore\Resource\Container` $container )` #### Parameters $container ``OpenCloud\ObjectStore\Resource\Container`` $container #### Returns `mixed` $this
`public `OpenCloud\ObjectStore\Resource\Container`` | # `getContainer( )` #### Returns ``OpenCloud\ObjectStore\Resource\Container``
`public mixed` | # `setName( mixed $name )` #### Parameters $name `mixed` $name string #### Returns `mixed` $this
`public string` | # `getName( )` #### Returns `string`
`public mixed` | # `setDirectory( mixed $directory )` #### Parameters $directory `mixed` $directory bool #### Returns `mixed` $this
`public boolean` | # `getDirectory( )` #### Returns `boolean`
`public boolean` | # `isDirectory( )` #### Returns `boolean` Is this data object a pseudo-directory?
`public mixed` | # `setContent( mixed $content )` #### Parameters $content `mixed` $content #### Returns `mixed` $this
`public Guzzle\Http\EntityBody` | # `getContent( )` #### Returns `Guzzle\Http\EntityBody`
`public mixed` | # `setContentType( string $contentType )` #### Parameters $contentType `string` $contentType #### Returns `mixed` $this
`public null|string` | # `getContentType( )` #### Returns `null|string`
`public mixed` | # `setContentLength( mixed $contentLength )` #### Parameters $contentLength `mixed` $contentType int #### Returns `mixed` $this
`public integer` | # `getContentLength( )` #### Returns `integer`
`public mixed` | # `setEtag( mixed $etag )` #### Parameters $etag `mixed` $etag #### Returns `mixed` $this
`public null|string` | # `getEtag( )` #### Returns `null|string`
`public` | # `setLastModified( mixed $lastModified )`
`public` | # `getLastModified( )`
`public` | # `primaryKeyField( )`
`public` | # `getUrl( mixed $path = null, array $params = array() )`
`public` | # `update( mixed $params = array() )`
`public Guzzle\Http\Message\Response` | # `copy( string $destination )` #### Parameters $destination `string` $destination Path (`container/object') of new object #### Returns `Guzzle\Http\Message\Response`
`public` | # `delete( mixed $params = array() )`
`public string` | # `getTemporaryUrl( mixed $expires, mixed $method )` Get a temporary URL for this object. Get a temporary URL for this object. #### Parameters $expires `mixed` $expires Expiration time in seconds $method `mixed` $method What method can use this URL? (`GET' or `PUT') #### Returns `string` #### Throws ``OpenCloud\Common\Exceptions\InvalidArgumentError`` ``OpenCloud\Common\Exceptions\ObjectError`` #### Link http://docs.rackspace.com/files/api/v1/cf-devguide/content/TempURL-d1a4450.html
`public mixed` | # `purge( null $email = null )` Remove this object from the CDN. Remove this object from the CDN. #### Parameters $email `null` $email #### Returns `mixed`
`public boolean|Guzzle\Http\Url` | # `getPublicUrl( string $type = OpenCloud\ObjectStore\Resource\UrlType::CDN )` #### Parameters $type `string` $type #### Returns `boolean|Guzzle\Http\Url`
`protected static` | # `headerIsValidMetadata( mixed $header )` #### Overrides `OpenCloud\ObjectStore\Resource\AbstractResource::headerIsValidMetadata()`

Methods inherited from OpenCloud\ObjectStore\Resource\AbstractResource
`appendToMetadata(), fromResponse(), getCdnService(), getClient(), getMetadata(), getService(), retrieveMetadata(), saveMetadata(), setMetadata(), stockHeaders(), stripPrefix(), trimHeaders(), unsetMetadataItem()`

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

Constants summary
`string` | `METADATA_LABEL` | `'Object'` | #

Constants inherited from OpenCloud\ObjectStore\Resource\AbstractResource
`GLOBAL_METADATA_PREFIX`

Properties summary
`protected The` | $name | `` | # file name of the object file name of the object
`protected Guzzle\Http\EntityBody` | $content | `` | #
`protected boolean` | $directory | `false` | # Whether or not this object is a "pseudo-directory" Whether or not this object is a "pseudo-directory" #### Link http://docs.openstack.org/trunk/openstack-object-storage/developer/content/pseudo-hierarchical-folders-directories.html
`protected string` | $contentType | `` | # The object's content type The object's content type
`protected The` | $contentLength | `` | # size of this object. size of this object.
`protected string` | $lastModified | `` | # Date of last modification. Date of last modification.
`protected string` | $etag | `` | # Etag. Etag.

Properties inherited from OpenCloud\ObjectStore\Resource\AbstractResource
`$metadata, $metadataClass, $service`

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