Service/WindowsAzure/Storage/Table.php

Show: inherited
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 [email protected] 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

Propertyprotectedstring $_apiVersion = '2009-09-19'
Default value'2009-09-19'Details
Type
string
Inherited_from
\Zend_Service_WindowsAzure_Storage::$$_apiVersion  
Inherited_from
\Zend_Service_WindowsAzure_Storage_BatchStorageAbstract::$$_apiVersion  
Propertyprotected\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
Propertyprotected\Zend_Service_WindowsAzure_Storage_Batch $_currentBatch = null
Propertyprotected\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
Propertyprotected\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
Propertyprotectedboolean $_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
Name Type Description
$host string

Storage host name

$accountName string

Account name for Windows Azure

$accountKey string

Account key for Windows Azure

$usePathStyleUri boolean

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
Name Type Description
$httpVerb string

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

$tableName string

Table name

$entity \Zend_Service_WindowsAzure_Storage_TableEntity

Entity to update

$verifyEtag boolean

Verify etag of the entity (used for concurrency)

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

Converts a string to a DateTime object.

Returns false on failure.

Parameters
Name Type Description
$value string

The string value to parse

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

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

Parameters
Name Type Description
$value \DateTime
Returns
Type Description
string
methodprotected_fillTemplate(string $templateText, array $variables = array()) : string

Fill text template with variables from key/value array

Parameters
Name Type Description
$templateText string

Template text

$variables array

Array containing key/value pairs

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

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

Parameters
Name Type Description
$entity \Zend_Service_WindowsAzure_Storage_TableEntity
Returns
Type Description
string
methodprotected_generateMetadataHeaders(array $metadata = array()) : \HTTP
Parameters
Name Type Description
$metadata array
Returns
Type Description
\HTTP headers containing metadata
methodprotected_getErrorMessage(\Zend_Http_Response $response, string $alternativeError = 'Unknown error.') : string

Get error message from Zend_Http_Response

Parameters
Name Type Description
$response \Zend_Http_Response

Repsonse

$alternativeError string

Alternative error message

Returns
Type Description
string
methodprotected_parseMetadataElement( $element = null) : array
Parameters
Name Type Description
$element
Returns
Type Description
array
methodprotected_parseMetadataHeaders(array $headers = array()) : array
Parameters
Name Type Description
$headers array

HTTP headers containing metadata

Returns
Type Description
array
methodprotected_parseResponse(\Zend_Http_Response $response = null) : object
Parameters
Name Type Description
$response \Zend_Http_Response

Response from HTTP call

Returns
Type Description
object
Throws
Exception Description
\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
Name Type Description
$path string

Path

$queryString string

Query string

$httpVerb string

HTTP verb the request will use

$headers array

x-ms headers to add

$forTableStorage boolean

Is the request for table storage?

$rawData mixed

Optional RAW HTTP data to be sent over the wire

$resourceType string

Resource type

$requiredPermission string

Required permission

Returns
Type Description
\Zend_Http_Response
methodprotected_rfcDate() : string

Generate RFC 1123 compliant date string

Returns
Type Description
string
methodpubliccreateQueryStringFromArray(array $queryString) : string
Parameters
Name Type Description
$queryString array

Array of elements

Returns
Type Description
string Assembled query string
methodpubliccreateTable(string $tableName = '') : \Zend_Service_WindowsAzure_Storage_TableInstance

Create table

Parameters
Name Type Description
$tableName string

Table name

Returns
Type Description
\Zend_Service_WindowsAzure_Storage_TableInstance
Throws
Exception Description
\Zend_Service_WindowsAzure_Exception
methodpubliccreateTableIfNotExists(string $tableName = '') : void

Create table if it does not exist

Parameters
Name Type Description
$tableName string

Table name

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

Delete entity from table

Parameters
Name Type Description
$tableName string

Table name

$entity \Zend_Service_WindowsAzure_Storage_TableEntity

Entity to delete

$verifyEtag boolean

Verify etag of the entity (used for concurrency)

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

Delete table

Parameters
Name Type Description
$tableName string

Table name

Throws
Exception Description
\Zend_Service_WindowsAzure_Exception
methodpublicgetAccountName() : string
Returns
Type Description
string
methodpublicgetBaseUrl() : string
Returns
Type Description
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
Name Type Description
$tableName string

Table name

$entity \Zend_Service_WindowsAzure_Storage_TableEntity

Entity to insert

Returns
Type Description
\Zend_Service_WindowsAzure_Storage_TableEntity
Throws
Exception Description
\Zend_Service_WindowsAzure_Exception
methodpublicisInBatch() : boolean
inherited

Is there a current batch?

Inherited from: \Zend_Service_WindowsAzure_Storage_BatchStorageAbstract::isInBatch()
Returns
Type Description
boolean
methodpublicisValidMetadataName(string $metadataName = '') : boolean
Parameters
Name Type Description
$metadataName string

Metadata name

Returns
Type Description
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
Name Type Description
$timestamp int
Returns
Type Description
string
methodpubliclistTables(string $nextTableName = '') : array

List tables

Parameters
Name Type Description
$nextTableName string

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

Returns
Type Description
array
Throws
Exception Description
\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
Name Type Description
$tableName string

Table name

$entity \Zend_Service_WindowsAzure_Storage_TableEntity

Entity to update

$verifyEtag boolean

Verify etag of the entity (used for concurrency)

$properties array

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

Throws
Exception Description
\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
Name Type Description
$operations array

Operations in batch

$forTableStorage boolean

Is the request for table storage?

$isSingleSelect boolean

Is the request a single select statement?

$resourceType string

Resource type

$requiredPermission string

Required permission

Returns
Type Description
\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
Name Type Description
$tableName
$filter string

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

$entityClass string

Entity class name

$nextPartitionKey string

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

$nextRowKey string

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

Returns
Type Description
array Array of Zend_Service_WindowsAzure_Storage_TableEntity
Throws
Exception Description
\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
Name Type Description
$tableName string

Table name

$partitionKey string

Partition key

$rowKey string

Row key

$entityClass string

Entity class name*

Returns
Type Description
\Zend_Service_WindowsAzure_Storage_TableEntity
Throws
Exception Description
\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
Name Type Description
$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
Name Type Description
$batch \Zend_Service_WindowsAzure_Storage_Batch

Current batch

Throws
Exception Description
\Zend_Service_WindowsAzure_Exception
methodpublicsetHttpClientChannel(\Zend_Http_Client_Adapter_Interface | string $adapterInstance = 'Zend_Http_Client_Adapter_Proxy') : void
Parameters
Name Type Description
$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
Name Type Description
$useProxy boolean

Use proxy?

$proxyUrl string

Proxy URL

$proxyPort int

Proxy port

$proxyCredentials string

Proxy credentials

methodpublicsetRetryPolicy(\Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy = null) : void
Parameters
Name Type Description
$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
Name Type Description
$value boolean
methodpublicstartBatch() : \Zend_Service_WindowsAzure_Storage_Batch
inherited

Starts a new batch operation set

Inherited from: \Zend_Service_WindowsAzure_Storage_BatchStorageAbstract::startBatch()
Returns
Type Description
\Zend_Service_WindowsAzure_Storage_Batch
Throws
Exception Description
\Zend_Service_WindowsAzure_Exception
methodpublictableExists(string $tableName = '') : boolean

Check if a table exists

Parameters
Name Type Description
$tableName string

Table name

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

Update entity by replacing it

Parameters
Name Type Description
$tableName string

Table name

$entity \Zend_Service_WindowsAzure_Storage_TableEntity

Entity to update

$verifyEtag boolean

Verify etag of the entity (used for concurrency)

Throws
Exception Description
\Zend_Service_WindowsAzure_Exception
methodpublicurlencode(string $value) : string
Parameters
Name Type Description
$value string

Value to encode

Returns
Type Description
string Encoded value
Documentation was generated by phpDocumentor 2.0.0a8.