Abstract Amazon class that handles the credentials for any of the Web Services that Amazon offers

category Zend
package Zend_Service_Amazon
subpackage SimpleDb
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
inherited_from \Zend_Service_Amazon_Abstract

 Methods

Create Amazon SimpleDB client.

__construct(string $accessKey, string $secretKey) 
inherited_from \Zend_Service_Amazon_Abstract::__construct()

Parameters

$accessKey

string

Override the default Access Key

$secretKey

string

Override the default Secret Key

Create Amazon client.

__construct($accessKey = null, $secretKey = null) : void
Inherited

Parameters

$accessKey

$secretKey

Add many attributes at once

batchPutAttributes(array $items, string $domainName, array $replace = array()) : void

Parameters

$items

array

$domainName

string

$replace

array

Create a new domain

createDomain(string $domainName) : boolean

Parameters

$domainName

string

Valid domain name of the domain to create

Returns

booleanTrue if successful, false if not

Delete attributes

deleteAttributes(string $domainName, string $itemName, array $attributes = array()) : void

Parameters

$domainName

string

$itemName

string

$attributes

array

Delete a domain

deleteDomain(string $domainName) : boolean

Parameters

$domainName

string

Valid domain name of the domain to delete

Returns

booleanTrue if successful, false if not

Get attributes API method

getAttributes(string $domainName, string $itemName, string|null $attributeName = null) : array

Parameters

$domainName

string

Domain name within database

$itemName

string

$attributeName

stringnull

Exceptions

\Zend_Service_Amazon_SimpleDb_Exception

Returns

array

Get SimpleDB endpoint

getEndpoint() : \Zend_Uri_Http

Returns

\Zend_Uri_Http

Gets the HTTP client object.

getHttpClient() : \Zend_Http_Client
InheritedStatic

Returns

\Zend_Http_Client

List domains

listDomains(integer $maxNumberOfDomains = 100, integer $nextToken = null) : array

Parameters

$maxNumberOfDomains

integer

$nextToken

integer

Returns

array0 or more domain names

Push attributes

putAttributes(string $domainName, string $itemName, array|\Traversable $attributes, array $replace = array()) : void

Parameters

$domainName

string

$itemName

string

$attributes

array\Traversable

$replace

array

Quote SDB value

quote(string $value) : string

Wraps it in ''

Parameters

$value

string

Returns

string

Quote SDB column or table name

quoteName(string $name) : string

Wraps it in ``

Parameters

$name

string

Exceptions

\Zend_Service_Amazon_SimpleDb_Exception

Returns

string

Select items from the database

select(string $selectExpression, null|string $nextToken = null) : \Zend_Service_Amazon_SimpleDb_Page

Parameters

$selectExpression

string

$nextToken

nullstring

Returns

\Zend_Service_Amazon_SimpleDb_Page

Set SimpleDB endpoint to use

setEndpoint(string|\Zend_Uri_Http $endpoint) : \Zend_Service_Amazon_SimpleDb

Parameters

$endpoint

string\Zend_Uri_Http

Exceptions

\Zend_Service_Amazon_SimpleDb_Exception
\Zend_Uri_Exception

Returns

\Zend_Service_Amazon_SimpleDb

Sets the HTTP client object to use for retrieving the feeds. If none is set, the default Zend_Http_Client will be used.

setHttpClient(\Zend_Http_Client $httpClient) 
InheritedStatic

Parameters

$httpClient

\Zend_Http_Client

Set the keys to use when accessing SQS.

setKeys($accessKey, $secretKey) : void
InheritedStatic

Parameters

$accessKey

$secretKey

Adds required authentication and version parameters to an array of parameters

_addRequiredParameters(array $parameters) : array

The required parameters are:

  • AWSAccessKey
  • SignatureVersion
  • Timestamp
  • Version and
  • Signature

If a required parameter is already set in the $parameters array, it is overwritten.

Parameters

$parameters

array

the array to which to add the required parameters.

Returns

array

Method to fetch the Access Key

_getAccessKey() : string
Inherited

Returns

string

Method to fetch the Secret AWS Key

_getSecretKey() : string
Inherited

Returns

string

Sends a HTTP request to the SimpleDB service using Zend_Http_Client

_sendRequest(array $params = array()) : \Zend_Service_Amazon_SimpleDb_Response

Parameters

$params

array

List of parameters to send with the request

Exceptions

\Zend_Service_Amazon_SimpleDb_Exception

Returns

\Zend_Service_Amazon_SimpleDb_Response

Computes the RFC 2104-compliant HMAC signature for request parameters

_signParameters(array $parameters) : string

This implements the Amazon Web Services signature, as per the following specification:

  1. Sort all request parameters (including SignatureVersion and excluding Signature, the value of which is being created), ignoring case.

  2. Iterate over the sorted list and append the parameter name (in its original case) and then its value. Do not URL-encode the parameter values before constructing this string. Do not use any separator characters when appending strings.

Parameters

$parameters

array

the parameters for which to get the signature.

Returns

stringthe signed data.

Checks for errors responses from Amazon

_checkForErrors(\Zend_Service_Amazon_SimpleDb_Response $response) 

Parameters

$response

\Zend_Service_Amazon_SimpleDb_Response

the response object to check.

Exceptions

\Zend_Service_Amazon_SimpleDb_Exception if one or more errors are returned from Amazon.

 Properties

 

Amazon Access Key

$_accessKey : string

Default

 

Amazon Access Key

$_defaultAccessKey : string

Default

null
Static
 

Amazon Secret Key

$_defaultSecretKey : string

Default

null
Static
 

HTTP Client used to query all web services

$_httpClient : \Zend_Http_Client

Default

null
Static
 

Period after which HTTP request will timeout in seconds

$_httpTimeout 

Default

10
 

The API version to use

$_sdbApiVersion 

Default

'2009-04-15'
 

The HTTP query server

$_sdbEndpoint 

Default

'sdb.amazonaws.com/'
 

Amazon Secret Key

$_secretKey : string

Default

 

Signature Encoding Method

$_signatureMethod 

Default

'HmacSHA256'
 

Signature Version

$_signatureVersion 

Default

'2'