Zend Framework  1.12
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Zend_Service_WindowsAzure_Storage_Table Class Reference

Public Member Functions

 setThrowExceptionOnMissingData ($value=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.
 
 getThrowExceptionOnMissingData ()
 Throw Zend_Service_WindowsAzure_Exception when a property is not specified in Windows Azure?
 
 __construct ($host=Zend_Service_WindowsAzure_Storage::URL_DEV_TABLE, $accountName=Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::DEVSTORE_ACCOUNT, $accountKey=Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::DEVSTORE_KEY, $usePathStyleUri=false, Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy=null)
 Creates a new Zend_Service_WindowsAzure_Storage_Table instance.
 
 tableExists ($tableName= '')
 Check if a table exists.
 
 listTables ($nextTableName= '')
 List tables.
 
 createTable ($tableName= '')
 Create table.
 
 createTableIfNotExists ($tableName= '')
 Create table if it does not exist.
 
 deleteTable ($tableName= '')
 Delete table.
 
 insertEntity ($tableName= '', Zend_Service_WindowsAzure_Storage_TableEntity $entity=null)
 Insert entity into table.
 
 deleteEntity ($tableName= '', Zend_Service_WindowsAzure_Storage_TableEntity $entity=null, $verifyEtag=false)
 Delete entity from table.
 
 retrieveEntityById ($tableName, $partitionKey, $rowKey, $entityClass= 'Zend_Service_WindowsAzure_Storage_DynamicTableEntity')
 Retrieve entity from table, by id.
 
 select ()
 Create a new Zend_Service_WindowsAzure_Storage_TableEntityQuery.
 
 retrieveEntities ($tableName= '', $filter= '', $entityClass= 'Zend_Service_WindowsAzure_Storage_DynamicTableEntity', $nextPartitionKey=null, $nextRowKey=null)
 Retrieve entities from table.
 
 updateEntity ($tableName= '', Zend_Service_WindowsAzure_Storage_TableEntity $entity=null, $verifyEtag=false)
 Update entity by replacing it.
 
 mergeEntity ($tableName= '', Zend_Service_WindowsAzure_Storage_TableEntity $entity=null, $verifyEtag=false, $properties=array())
 Update entity by adding or updating properties.
 
- Public Member Functions inherited from Zend_Service_WindowsAzure_Storage_BatchStorageAbstract
 setCurrentBatch (Zend_Service_WindowsAzure_Storage_Batch $batch=null)
 Set current batch.
 
 getCurrentBatch ()
 Get current batch.
 
 isInBatch ()
 Is there a current batch?
 
 startBatch ()
 Starts a new batch operation set.
 
 performBatch ($operations=array(), $forTableStorage=false, $isSingleSelect=false, $resourceType=Zend_Service_WindowsAzure_Storage::RESOURCE_UNKNOWN, $requiredPermission=Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_READ)
 Perform batch using Zend_Http_Client channel, combining all batch operations into one request.
 
- Public Member Functions inherited from Zend_Service_WindowsAzure_Storage
 __construct ($host=self::URL_DEV_BLOB, $accountName=Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::DEVSTORE_ACCOUNT, $accountKey=Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::DEVSTORE_KEY, $usePathStyleUri=false, Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy=null)
 Creates a new Zend_Service_WindowsAzure_Storage instance.
 
 setHttpClientChannel ($adapterInstance= 'Zend_Http_Client_Adapter_Proxy')
 Set the HTTP client channel to use.
 
 getHttpClientChannel ()
 Retrieve HTTP client channel.
 
 setRetryPolicy (Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy=null)
 Set retry policy to use when making requests.
 
 setProxy ($useProxy=false, $proxyUrl= '', $proxyPort=80, $proxyCredentials= '')
 Set proxy.
 
 getAccountName ()
 Returns the Windows Azure account name.
 
 getBaseUrl ()
 Get base URL for creating requests.
 
 setCredentials (Zend_Service_WindowsAzure_Credentials_CredentialsAbstract $credentials)
 Set Zend_Service_WindowsAzure_Credentials_CredentialsAbstract instance.
 
 getCredentials ()
 Get Zend_Service_WindowsAzure_Credentials_CredentialsAbstract instance.
 
 isoDate ($timestamp=null)
 Generate ISO 8601 compliant date string in UTC time zone.
 

Protected Member Functions

 _getErrorMessage (Zend_Http_Response $response, $alternativeError= 'Unknown error.')
 Get error message from Zend_Http_Response.
 
 _changeEntity ($httpVerb=Zend_Http_Client::PUT, $tableName= '', Zend_Service_WindowsAzure_Storage_TableEntity $entity=null, $verifyEtag=false)
 Update entity / merge entity.
 
 _rfcDate ()
 Generate RFC 1123 compliant date string.
 
 _fillTemplate ($templateText, $variables=array())
 Fill text template with variables from key/value array.
 
 _generateAzureRepresentation (Zend_Service_WindowsAzure_Storage_TableEntity $entity=null)
 Generate Azure representation from entity (creates atompub markup from properties)
 
 _performRequest ($path= '/', $queryString= '', $httpVerb=Zend_Http_Client::GET, $headers=array(), $forTableStorage=false, $rawData=null, $resourceType=Zend_Service_WindowsAzure_Storage::RESOURCE_UNKNOWN, $requiredPermission=Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_READ)
 Perform request using Zend_Http_Client channel.
 
 _convertToDateTime ($value= '')
 Converts a string to a DateTime object.
 
 _convertToEdmDateTime (DateTime $value)
 Converts a DateTime object into an Edm.DaeTime value in UTC timezone, represented as a string.
 

Protected Attributes

 $_throwExceptionOnMissingData = true
 
- Protected Attributes inherited from Zend_Service_WindowsAzure_Storage_BatchStorageAbstract
 $_currentBatch = null
 
- Protected Attributes inherited from Zend_Service_WindowsAzure_Storage
 $_apiVersion = '2009-09-19'
 
 $_host = ''
 
 $_accountName = ''
 
 $_accountKey = ''
 
 $_usePathStyleUri = false
 
 $_credentials = null
 
 $_retryPolicy = null
 
 $_httpClientChannel = null
 
 $_useProxy = false
 
 $_proxyUrl = ''
 
 $_proxyPort = 80
 
 $_proxyCredentials = ''
 

Additional Inherited Members

- Static Public Member Functions inherited from Zend_Service_WindowsAzure_Storage
static urlencode ($value)
 URL encode function.
 
static isValidMetadataName ($metadataName= '')
 Is valid metadata name?
 
static createQueryStringFromArray ($queryString)
 Builds a query string from an array of elements.
 
- Public Attributes inherited from Zend_Service_WindowsAzure_Storage
const URL_DEV_BLOB = "127.0.0.1:10000"
 Development storage URLS.
 
const URL_DEV_QUEUE = "127.0.0.1:10001"
 
const URL_DEV_TABLE = "127.0.0.1:10002"
 
const URL_CLOUD_BLOB = "blob.core.windows.net"
 Live storage URLS.
 
const URL_CLOUD_QUEUE = "queue.core.windows.net"
 
const URL_CLOUD_TABLE = "table.core.windows.net"
 
const RESOURCE_UNKNOWN = "unknown"
 Resource types.
 
const RESOURCE_CONTAINER = "c"
 
const RESOURCE_BLOB = "b"
 
const RESOURCE_TABLE = "t"
 
const RESOURCE_ENTITY = "e"
 
const RESOURCE_QUEUE = "q"
 
const PREFIX_PROPERTIES = "x-ms-prop-"
 HTTP header prefixes.
 
const PREFIX_METADATA = "x-ms-meta-"
 
const PREFIX_STORAGE_HEADER = "x-ms-"
 

Constructor & Destructor Documentation

Creates a new Zend_Service_WindowsAzure_Storage_Table instance.

Parameters
string$hostStorage host name
string$accountNameAccount name for Windows Azure
string$accountKeyAccount key for Windows Azure
boolean$usePathStyleUriUse path-style URI's
Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract$retryPolicyRetry policy to use when making requests

Member Function Documentation

_changeEntity (   $httpVerb = Zend_Http_Client::PUT,
  $tableName = '',
Zend_Service_WindowsAzure_Storage_TableEntity  $entity = null,
  $verifyEtag = false 
)
protected

Update entity / merge entity.

Parameters
string$httpVerbHTTP verb to use (PUT = update, MERGE = merge)
string$tableNameTable name
Zend_Service_WindowsAzure_Storage_TableEntity$entityEntity to update
boolean$verifyEtagVerify etag of the entity (used for concurrency)
Exceptions
Zend_Service_WindowsAzure_Exception
_convertToDateTime (   $value = '')
protected

Converts a string to a DateTime object.

Returns false on failure.

Parameters
string$valueThe string value to parse
Returns
DateTime|boolean
_convertToEdmDateTime ( DateTime  $value)
protected

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

Parameters
DateTime$value
Returns
string
_fillTemplate (   $templateText,
  $variables = array() 
)
protected

Fill text template with variables from key/value array.

Parameters
string$templateTextTemplate text
array$variablesArray containing key/value pairs
Returns
string
_generateAzureRepresentation ( Zend_Service_WindowsAzure_Storage_TableEntity  $entity = null)
protected

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

Parameters
Zend_Service_WindowsAzure_Storage_TableEntity$entity
Returns
string
_getErrorMessage ( Zend_Http_Response  $response,
  $alternativeError = 'Unknown error.' 
)
protected

Get error message from Zend_Http_Response.

Parameters
Zend_Http_Response$responseRepsonse
string$alternativeErrorAlternative error message
Returns
string
_performRequest (   $path = '/',
  $queryString = '',
  $httpVerb = Zend_Http_Client::GET,
  $headers = array(),
  $forTableStorage = false,
  $rawData = null,
  $resourceType = Zend_Service_WindowsAzure_Storage::RESOURCE_UNKNOWN,
  $requiredPermission = Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_READ 
)
protected

Perform request using Zend_Http_Client channel.

Parameters
string$pathPath
string$queryStringQuery string
string$httpVerbHTTP verb the request will use
array$headersx-ms headers to add
boolean$forTableStorageIs the request for table storage?
mixed$rawDataOptional RAW HTTP data to be sent over the wire
string$resourceTypeResource type
string$requiredPermissionRequired permission
Returns
Zend_Http_Response
_rfcDate ( )
protected

Generate RFC 1123 compliant date string.

Returns
string
createTable (   $tableName = '')

Create table.

Parameters
string$tableNameTable name
Returns
Zend_Service_WindowsAzure_Storage_TableInstance
Exceptions
Zend_Service_WindowsAzure_Exception
createTableIfNotExists (   $tableName = '')

Create table if it does not exist.

Parameters
string$tableNameTable name
Exceptions
Zend_Service_WindowsAzure_Exception
deleteEntity (   $tableName = '',
Zend_Service_WindowsAzure_Storage_TableEntity  $entity = null,
  $verifyEtag = false 
)

Delete entity from table.

Parameters
string$tableNameTable name
Zend_Service_WindowsAzure_Storage_TableEntity$entityEntity to delete
boolean$verifyEtagVerify etag of the entity (used for concurrency)
Exceptions
Zend_Service_WindowsAzure_Exception
deleteTable (   $tableName = '')

Delete table.

Parameters
string$tableNameTable name
Exceptions
Zend_Service_WindowsAzure_Exception
getThrowExceptionOnMissingData ( )

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

insertEntity (   $tableName = '',
Zend_Service_WindowsAzure_Storage_TableEntity  $entity = null 
)

Insert entity into table.

Parameters
string$tableNameTable name
Zend_Service_WindowsAzure_Storage_TableEntity$entityEntity to insert
Returns
Zend_Service_WindowsAzure_Storage_TableEntity
Exceptions
Zend_Service_WindowsAzure_Exception
listTables (   $nextTableName = '')

List tables.

Parameters
string$nextTableNameNext table name, used for listing tables when total amount of tables is > 1000.
Returns
array
Exceptions
Zend_Service_WindowsAzure_Exception
mergeEntity (   $tableName = '',
Zend_Service_WindowsAzure_Storage_TableEntity  $entity = null,
  $verifyEtag = false,
  $properties = array() 
)

Update entity by adding or updating properties.

Parameters
string$tableNameTable name
Zend_Service_WindowsAzure_Storage_TableEntity$entityEntity to update
boolean$verifyEtagVerify etag of the entity (used for concurrency)
array$propertiesProperties to merge. All properties will be used when omitted.
Exceptions
Zend_Service_WindowsAzure_Exception
retrieveEntities (   $tableName = '',
  $filter = '',
  $entityClass = 'Zend_Service_WindowsAzure_Storage_DynamicTableEntity',
  $nextPartitionKey = null,
  $nextRowKey = null 
)

Retrieve entities from table.

Parameters
string$tableName,|Zend_Service_WindowsAzure_Storage_TableEntityQueryTable name -or- Zend_Service_WindowsAzure_Storage_TableEntityQuery instance
string$filterFilter condition (not applied when $tableName is a Zend_Service_WindowsAzure_Storage_TableEntityQuery instance)
string$entityClassEntity class name
string$nextPartitionKeyNext partition key, used for listing entities when total amount of entities is > 1000.
string$nextRowKeyNext row key, used for listing entities when total amount of entities is > 1000.
Returns
array Array of Zend_Service_WindowsAzure_Storage_TableEntity
Exceptions
Zend_Service_WindowsAzure_Exception
retrieveEntityById (   $tableName,
  $partitionKey,
  $rowKey,
  $entityClass = 'Zend_Service_WindowsAzure_Storage_DynamicTableEntity' 
)

Retrieve entity from table, by id.

Parameters
string$tableNameTable name
string$partitionKeyPartition key
string$rowKeyRow key
string$entityClassEntity class name*
Returns
Zend_Service_WindowsAzure_Storage_TableEntity
Exceptions
Zend_Service_WindowsAzure_Exception
select ( )
setThrowExceptionOnMissingData (   $value = 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.

Parameters
boolean$value
tableExists (   $tableName = '')

Check if a table exists.

Parameters
string$tableNameTable name
Returns
boolean
updateEntity (   $tableName = '',
Zend_Service_WindowsAzure_Storage_TableEntity  $entity = null,
  $verifyEtag = false 
)

Update entity by replacing it.

Parameters
string$tableNameTable name
Zend_Service_WindowsAzure_Storage_TableEntity$entityEntity to update
boolean$verifyEtagVerify etag of the entity (used for concurrency)
Exceptions
Zend_Service_WindowsAzure_Exception

Member Data Documentation

$_throwExceptionOnMissingData = true
protected