Service/WindowsAzure/Storage/Table.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Service_WindowsAzure  
Subpackage
Storage  
Version
$Id: Table.php 24697 2012-03-23 13:11:04Z ezimuel $  

\Zend_Service_WindowsAzure_Storage_Table

Package: Zend\Service\WindowsAzure\Storage
Parent(s)
\Zend_Service_WindowsAzure_Storage_BatchStorageAbstract < \Zend_Service_WindowsAzure_Storage
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

Properties

>VPropertyprotected\Zend_Service_WindowsAzure_Credentials_CredentialsAbstract $_credentials = null
inherited
Zend_Service_WindowsAzure_Credentials_CredentialsAbstract instance
Inherited from: \Zend_Service_WindowsAzure_Storage::$$_credentials\Zend_Service_WindowsAzure_Storage_BatchStorageAbstract::$$_credentials
>VPropertyprotected\Zend_Service_WindowsAzure_Storage_Batch $_currentBatch = null
>VPropertyprotected\Zend_Http_Client $_httpClientChannel = null
inherited
Zend_Http_Client channel used for communication with REST services
Inherited from: \Zend_Service_WindowsAzure_Storage::$$_httpClientChannel\Zend_Service_WindowsAzure_Storage_BatchStorageAbstract::$$_httpClientChannel
>VPropertyprotected\Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract $_retryPolicy = null
inherited
Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract instance
Inherited from: \Zend_Service_WindowsAzure_Storage::$$_retryPolicy\Zend_Service_WindowsAzure_Storage_BatchStorageAbstract::$$_retryPolicy
>VPropertyprotectedboolean $_throwExceptionOnMissingData = true
Throw Zend_Service_WindowsAzure_Exception when a property is not specified in Windows Azure? Defaults to true, making behaviour similar to Windows Azure StorageClient in .NET.
Default valuetrueDetails
Type
boolean

Methods

methodpublic__construct(string $host = \Zend_Service_WindowsAzure_Storage::URL_DEV_TABLE, string $accountName = \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::DEVSTORE_ACCOUNT, string $accountKey = \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::DEVSTORE_KEY, boolean $usePathStyleUri = false, \Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy = null) : void

Creates a new Zend_Service_WindowsAzure_Storage_Table instance

Parameters
NameTypeDescription
$hoststring

Storage host name

$accountNamestring

Account name for Windows Azure

$accountKeystring

Account key for Windows Azure

$usePathStyleUriboolean

Use path-style URI's

$retryPolicy\Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract

Retry policy to use when making requests

methodprotected_changeEntity(string $httpVerb = \Zend_Http_Client::PUT, string $tableName = '', \Zend_Service_WindowsAzure_Storage_TableEntity $entity = null, boolean $verifyEtag = false) : void

Update entity / merge entity

Parameters
NameTypeDescription
$httpVerbstring

HTTP verb to use (PUT = update, MERGE = merge)

$tableNamestring

Table name

$entity\Zend_Service_WindowsAzure_Storage_TableEntity

Entity to update

$verifyEtagboolean

Verify etag of the entity (used for concurrency)

Throws
ExceptionDescription
\Zend_Service_WindowsAzure_Exception
methodprotected_convertToDateTime(string $value = '') : \DateTime | boolean

Converts a string to a DateTime object.

Returns false on failure.

Parameters
NameTypeDescription
$valuestring

The string value to parse

Returns
TypeDescription
\DateTime | boolean
methodprotected_convertToEdmDateTime(\DateTime $value) : string

Converts a DateTime object into an Edm.DaeTime value in UTC timezone, represented as a string.

Parameters
NameTypeDescription
$value\DateTime
Returns
TypeDescription
string
methodprotected_fillTemplate(string $templateText, array $variables = array()) : string

Fill text template with variables from key/value array

Parameters
NameTypeDescription
$templateTextstring

Template text

$variablesarray

Array containing key/value pairs

Returns
TypeDescription
string
methodprotected_generateAzureRepresentation(\Zend_Service_WindowsAzure_Storage_TableEntity $entity = null) : string

Generate Azure representation from entity (creates atompub markup from properties)

Parameters
NameTypeDescription
$entity\Zend_Service_WindowsAzure_Storage_TableEntity
Returns
TypeDescription
string
methodprotected_generateMetadataHeaders(array $metadata = array()) : \HTTP
Parameters
NameTypeDescription
$metadataarray
Returns
TypeDescription
\HTTPheaders containing metadata
methodprotected_getErrorMessage(\Zend_Http_Response $response, string $alternativeError = 'Unknown error.') : string

Get error message from Zend_Http_Response

Parameters
NameTypeDescription
$response\Zend_Http_Response

Repsonse

$alternativeErrorstring

Alternative error message

Returns
TypeDescription
string
methodprotected_parseMetadataElement( $element = null) : array
Parameters
NameTypeDescription
$element
Returns
TypeDescription
array
methodprotected_parseMetadataHeaders(array $headers = array()) : array
Parameters
NameTypeDescription
$headersarray

HTTP headers containing metadata

Returns
TypeDescription
array
methodprotected_parseResponse(\Zend_Http_Response $response = null) : object
Parameters
NameTypeDescription
$response\Zend_Http_Response

Response from HTTP call

Returns
TypeDescription
object
Throws
ExceptionDescription
\Zend_Service_WindowsAzure_Exception
methodprotected_performRequest(string $path = '/', string $queryString = '', string $httpVerb = \Zend_Http_Client::GET, array $headers = array(), boolean $forTableStorage = false, mixed $rawData = null, string $resourceType = \Zend_Service_WindowsAzure_Storage::RESOURCE_UNKNOWN, string $requiredPermission = \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_READ) : \Zend_Http_Response

Perform request using Zend_Http_Client channel

Parameters
NameTypeDescription
$pathstring

Path

$queryStringstring

Query string

$httpVerbstring

HTTP verb the request will use

$headersarray

x-ms headers to add

$forTableStorageboolean

Is the request for table storage?

$rawDatamixed

Optional RAW HTTP data to be sent over the wire

$resourceTypestring

Resource type

$requiredPermissionstring

Required permission

Returns
TypeDescription
\Zend_Http_Response
methodprotected_rfcDate() : string

Generate RFC 1123 compliant date string

Returns
TypeDescription
string
methodpubliccreateQueryStringFromArray(array $queryString) : string
Parameters
NameTypeDescription
$queryStringarray

Array of elements

Returns
TypeDescription
stringAssembled query string
methodpubliccreateTable(string $tableName = '') : \Zend_Service_WindowsAzure_Storage_TableInstance

Create table

Parameters
NameTypeDescription
$tableNamestring

Table name

Returns
TypeDescription
\Zend_Service_WindowsAzure_Storage_TableInstance
Throws
ExceptionDescription
\Zend_Service_WindowsAzure_Exception
methodpubliccreateTableIfNotExists(string $tableName = '') : void

Create table if it does not exist

Parameters
NameTypeDescription
$tableNamestring

Table name

Throws
ExceptionDescription
\Zend_Service_WindowsAzure_Exception
methodpublicdeleteEntity(string $tableName = '', \Zend_Service_WindowsAzure_Storage_TableEntity $entity = null, boolean $verifyEtag = false) : void

Delete entity from table

Parameters
NameTypeDescription
$tableNamestring

Table name

$entity\Zend_Service_WindowsAzure_Storage_TableEntity

Entity to delete

$verifyEtagboolean

Verify etag of the entity (used for concurrency)

Throws
ExceptionDescription
\Zend_Service_WindowsAzure_Exception
methodpublicdeleteTable(string $tableName = '') : void

Delete table

Parameters
NameTypeDescription
$tableNamestring

Table name

Throws
ExceptionDescription
\Zend_Service_WindowsAzure_Exception
methodpublicgetAccountName() : string
Returns
TypeDescription
string
methodpublicgetBaseUrl() : string
Returns
TypeDescription
string
methodpublicgetThrowExceptionOnMissingData() : void

Throw Zend_Service_WindowsAzure_Exception when a property is not specified in Windows Azure?

methodpublicinsertEntity(string $tableName = '', \Zend_Service_WindowsAzure_Storage_TableEntity $entity = null) : \Zend_Service_WindowsAzure_Storage_TableEntity

Insert entity into table

Parameters
NameTypeDescription
$tableNamestring

Table name

$entity\Zend_Service_WindowsAzure_Storage_TableEntity

Entity to insert

Returns
TypeDescription
\Zend_Service_WindowsAzure_Storage_TableEntity
Throws
ExceptionDescription
\Zend_Service_WindowsAzure_Exception
methodpublicisInBatch() : boolean
inherited

Is there a current batch?

Inherited from: \Zend_Service_WindowsAzure_Storage_BatchStorageAbstract::isInBatch()
Returns
TypeDescription
boolean
methodpublicisValidMetadataName(string $metadataName = '') : boolean
Parameters
NameTypeDescription
$metadataNamestring

Metadata name

Returns
TypeDescription
boolean
methodpublicisoDate(int $timestamp = null) : string
inherited

Generate ISO 8601 compliant date string in UTC time zone

Inherited from: \Zend_Service_WindowsAzure_Storage::isoDate()\Zend_Service_WindowsAzure_Storage_BatchStorageAbstract::isoDate()
Parameters
NameTypeDescription
$timestampint
Returns
TypeDescription
string
methodpubliclistTables(string $nextTableName = '') : array

List tables

Parameters
NameTypeDescription
$nextTableNamestring

Next table name, used for listing tables when total amount of tables is > 1000.

Returns
TypeDescription
array
Throws
ExceptionDescription
\Zend_Service_WindowsAzure_Exception
methodpublicmergeEntity(string $tableName = '', \Zend_Service_WindowsAzure_Storage_TableEntity $entity = null, boolean $verifyEtag = false, array $properties = array()) : void

Update entity by adding or updating properties

Parameters
NameTypeDescription
$tableNamestring

Table name

$entity\Zend_Service_WindowsAzure_Storage_TableEntity

Entity to update

$verifyEtagboolean

Verify etag of the entity (used for concurrency)

$propertiesarray

Properties to merge. All properties will be used when omitted.

Throws
ExceptionDescription
\Zend_Service_WindowsAzure_Exception
methodpublicperformBatch(array $operations = array(), boolean $forTableStorage = false, boolean $isSingleSelect = false, string $resourceType = \Zend_Service_WindowsAzure_Storage::RESOURCE_UNKNOWN, string $requiredPermission = \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_READ) : \Zend_Http_Response
inherited

Perform batch using Zend_Http_Client channel, combining all batch operations into one request

Inherited from: \Zend_Service_WindowsAzure_Storage_BatchStorageAbstract::performBatch()
Parameters
NameTypeDescription
$operationsarray

Operations in batch

$forTableStorageboolean

Is the request for table storage?

$isSingleSelectboolean

Is the request a single select statement?

$resourceTypestring

Resource type

$requiredPermissionstring

Required permission

Returns
TypeDescription
\Zend_Http_Response
methodpublicretrieveEntities( $tableName = '', string $filter = '', string $entityClass = 'Zend_Service_WindowsAzure_Storage_DynamicTableEntity', string $nextPartitionKey = null, string $nextRowKey = null) : array

Retrieve entities from table

Parameters
NameTypeDescription
$tableName
$filterstring

Filter condition (not applied when $tableName is a Zend_Service_WindowsAzure_Storage_TableEntityQuery instance)

$entityClassstring

Entity class name

$nextPartitionKeystring

Next partition key, used for listing entities when total amount of entities is > 1000.

$nextRowKeystring

Next row key, used for listing entities when total amount of entities is > 1000.

Returns
TypeDescription
arrayArray of Zend_Service_WindowsAzure_Storage_TableEntity
Throws
ExceptionDescription
\Zend_Service_WindowsAzure_Exception
methodpublicretrieveEntityById(string $tableName, string $partitionKey, string $rowKey, string $entityClass = 'Zend_Service_WindowsAzure_Storage_DynamicTableEntity') : \Zend_Service_WindowsAzure_Storage_TableEntity

Retrieve entity from table, by id

Parameters
NameTypeDescription
$tableNamestring

Table name

$partitionKeystring

Partition key

$rowKeystring

Row key

$entityClassstring

Entity class name*

Returns
TypeDescription
\Zend_Service_WindowsAzure_Storage_TableEntity
Throws
ExceptionDescription
\Zend_Service_WindowsAzure_Exception
methodpublicselect() : \Zend_Service_WindowsAzure_Storage_TableEntityQuery

Create a new Zend_Service_WindowsAzure_Storage_TableEntityQuery

methodpublicsetCredentials(\Zend_Service_WindowsAzure_Credentials_CredentialsAbstract $credentials) : void
inherited

Set Zend_Service_WindowsAzure_Credentials_CredentialsAbstract instance

Inherited from: \Zend_Service_WindowsAzure_Storage::setCredentials()\Zend_Service_WindowsAzure_Storage_BatchStorageAbstract::setCredentials()
Parameters
NameTypeDescription
$credentials\Zend_Service_WindowsAzure_Credentials_CredentialsAbstract

Zend_Service_WindowsAzure_Credentials_CredentialsAbstract instance to use for request signing.

methodpublicsetCurrentBatch(\Zend_Service_WindowsAzure_Storage_Batch $batch = null) : void
Parameters
NameTypeDescription
$batch\Zend_Service_WindowsAzure_Storage_Batch

Current batch

Throws
ExceptionDescription
\Zend_Service_WindowsAzure_Exception
methodpublicsetHttpClientChannel(\Zend_Http_Client_Adapter_Interface | string $adapterInstance = 'Zend_Http_Client_Adapter_Proxy') : void
Parameters
NameTypeDescription
$adapterInstance\Zend_Http_Client_Adapter_Interface | string

Adapter instance or adapter class name.

methodpublicsetProxy(boolean $useProxy = false, string $proxyUrl = '', int $proxyPort = 80, string $proxyCredentials = '') : void
Parameters
NameTypeDescription
$useProxyboolean

Use proxy?

$proxyUrlstring

Proxy URL

$proxyPortint

Proxy port

$proxyCredentialsstring

Proxy credentials

methodpublicsetRetryPolicy(\Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy = null) : void
Parameters
NameTypeDescription
$retryPolicy\Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract

Retry policy to use when making requests

methodpublicsetThrowExceptionOnMissingData(boolean $value = true) : void

Throw Zend_Service_WindowsAzure_Exception when a property is not specified in Windows Azure? Defaults to true, making behaviour similar to Windows Azure StorageClient in .NET.

Parameters
NameTypeDescription
$valueboolean
methodpublictableExists(string $tableName = '') : boolean

Check if a table exists

Parameters
NameTypeDescription
$tableNamestring

Table name

Returns
TypeDescription
boolean
methodpublicupdateEntity(string $tableName = '', \Zend_Service_WindowsAzure_Storage_TableEntity $entity = null, boolean $verifyEtag = false) : void

Update entity by replacing it

Parameters
NameTypeDescription
$tableNamestring

Table name

$entity\Zend_Service_WindowsAzure_Storage_TableEntity

Entity to update

$verifyEtagboolean

Verify etag of the entity (used for concurrency)

Throws
ExceptionDescription
\Zend_Service_WindowsAzure_Exception
methodpublicurlencode(string $value) : string
Parameters
NameTypeDescription
$valuestring

Value to encode

Returns
TypeDescription
stringEncoded value
Documentation was generated by phpDocumentor 2.0.0a12.