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.
Gdata Spreadsheets
As the Google data API protocol is based upon the Atom Publishing Protocol (APP), Gdata functionality extends the appropriate Zend_Gdata_App classes

GetWorksheetEntry(
string $location
)
:
\WorksheetEntry
Gets a worksheet entry.
Name | Type | Description |
---|---|---|
$location | string | A DocumentQuery or a URI specifying the entry location. |
Type | Description |
---|---|
\WorksheetEntry |

__call(
string $method, array $args
)
:
void
Provides a magic factory method to instantiate new objects with shorter syntax than would otherwise be required by the Zend Framework naming conventions. For instance, to construct a new Zend_Gdata_Calendar_Extension_Color, a developer simply needs to do $gCal->newColor(). For this magic constructor, packages are searched in the same order as which they appear in the $_registeredPackages array
Inherited from: \Zend_Gdata_App::__call()Name | Type | Description |
---|---|---|
$method | string | The method name being called |
$args | array | The arguments passed to the call |
Exception | Description |
---|---|
\Zend_Gdata_App_Exception |

__construct(
\Zend_Http_Client $client
=
null, string $applicationId
=
MyCompany-MyApp-1.0
)
:
void
Create Gdata_Spreadsheets object
Name | Type | Description |
---|---|---|
$client | \Zend_Http_Client | (optional) The HTTP client to use when when communicating with the Google servers. |
$applicationId | string | The identity of the app in the form of Company-AppName-Version |

delete(
mixed $data, $remainingRedirects
=
null
)
:
void
DELETE entry with client object
Inherited from: \Zend_Gdata_App::delete()Name | Type | Description |
---|---|---|
$data | mixed | The Zend_Gdata_App_Entry or URL to delete |
$remainingRedirects |
Exception | Description |
---|---|
\Zend_Gdata_App_Exception | |
\Zend_Gdata_App_HttpException | |
\Zend_Gdata_App_InvalidArgumentException |

deleteRow(
\ListEntry $entry
)
:
void
Deletes an existing row .
Name | Type | Description |
---|---|---|
$entry | \ListEntry | The row to delete |

get(
string $uri, array $extraHeaders
=
array
)
:
\Zend_Http_Response
GET a URI using client object.
Inherited from: \Zend_Gdata_App::get()Name | Type | Description |
---|---|---|
$uri | string | GET URI |
$extraHeaders | array | Extra headers to add to the request, as an array of string-based key/value pairs. |
Type | Description |
---|---|
\Zend_Http_Response |
Exception | Description |
---|---|
\Zend_Gdata_App_HttpException |

getCellEntry(
string $location
)
:
\CellEntry
Gets a cell entry.
Name | Type | Description |
---|---|---|
$location | string | A CellQuery or a URI specifying the entry location. |
Type | Description |
---|---|
\CellEntry |

getCellFeed(
string $location
)
:
\CellFeed
Gets a cell feed.
Name | Type | Description |
---|---|---|
$location | string | A CellQuery, WorksheetEntry or a URI specifying the feed location. |
Type | Description |
---|---|
\CellFeed |

getEntry(
mixed $location, $className
=
Zend_Gdata_Entry
)
:
string|\Zend_Gdata_App_Entry
Retrieve entry as string or object
Inherited from: \Zend_Gdata::getEntry()Name | Type | Description |
---|---|---|
$location | mixed | The location as string or Zend_Gdata_Query |
$className |
Type | Description |
---|---|
string\Zend_Gdata_App_Entry | Returns string only if the object mapping has been disabled explicitly by passing false to the useObjectMapping() function. |
Exception | Description |
---|---|
\Zend_Gdata_App_InvalidArgumentException |

getFeed(
mixed $location, string $className
=
Zend_Gdata_Feed
)
:
string|\Zend_Gdata_App_Feed
Retrieve feed as string or object
Inherited from: \Zend_Gdata::getFeed()Name | Type | Description |
---|---|---|
$location | mixed | The location as string or Zend_Gdata_Query |
$className | string | The class type to use for returning the feed |
Type | Description |
---|---|
string\Zend_Gdata_App_Feed | Returns string only if the object mapping has been disabled explicitly by passing false to the useObjectMapping() function. |
Exception | Description |
---|---|
\Zend_Gdata_App_InvalidArgumentException |

getHttpClient(
)
:
\Zend_Http_Client
Get the Zend_Http_Client object used for communication
Inherited from: \Zend_Gdata_App::getHttpClient()Type | Description |
---|---|
\Zend_Http_Client |

getListEntry(
string $location
)
:
\ListEntry
Gets a list entry.
Name | Type | Description |
---|---|---|
$location | string | A ListQuery or a URI specifying the entry location. |
Type | Description |
---|---|
\ListEntry |

getListFeed(
mixed $location
)
:
\ListFeed
Gets a list feed.
Name | Type | Description |
---|---|---|
$location | mixed | A ListQuery, WorksheetEntry or string URI specifying the feed location. |
Type | Description |
---|---|
\ListFeed |

getMajorProtocolVersion(
)
:
int
Get the major protocol version that is in use.
Inherited from: \Zend_Gdata_App::getMajorProtocolVersion()Type | Description |
---|---|
int | The major protocol version in use. |

getMaxRedirects(
)
:
int
Get the maximum number of redirects to follow during HTTP operations
Inherited from: \Zend_Gdata_App::getMaxRedirects()Type | Description |
---|---|
int | Maximum number of redirects to follow |

getMinorProtocolVersion(
)
:
\(int|\NULL)
Get the minor protocol version that is in use.
Inherited from: \Zend_Gdata_App::getMinorProtocolVersion()Type | Description |
---|---|
\(int\NULL) | The major protocol version in use, or NULL if no minor version is specified. |

getSpreadsheetCellFeedContents(
mixed $location, string $range
=
null, boolean $empty
=
false
)
:
array
Returns the content of all cells as an associative array, indexed off the cell location (ie 'A1', 'D4', etc). Each element of the array is an associative array with a 'value' and a 'function'.
Only non-empty cells are returned by default. 'range' is the value of the 'range' query parameter specified at: http://code.google.com/apis/spreadsheets/reference.html#cells_Parameters
Name | Type | Description |
---|---|---|
$location | mixed | A CellQuery, WorksheetEntry or a URL (w/o query string) specifying the feed location. |
$range | string | The range of cells to retrieve |
$empty | boolean | Whether to retrieve empty cells |
Type | Description |
---|---|
array | An associative array of cells |

getSpreadsheetEntry(
string $location
)
:
\SpreadsheetEntry
Gets a spreadsheet entry.
Name | Type | Description |
---|---|---|
$location | string | A DocumentQuery or a URI specifying the entry location. |
Type | Description |
---|---|
\SpreadsheetEntry |

getSpreadsheetFeed(
mixed $location
=
null
)
:
\Zend_Gdata_Spreadsheets_SpreadsheetFeed
Gets a spreadsheet feed.
Name | Type | Description |
---|---|---|
$location | mixed | A DocumentQuery or a string URI specifying the feed location. |
Type | Description |
---|---|
\Zend_Gdata_Spreadsheets_SpreadsheetFeed |

getSpreadsheetListFeedContents(
mixed $location
)
:
array
Returns the content of all rows as an associative array
Name | Type | Description |
---|---|---|
$location | mixed | A ListQuery or string URI specifying the feed location. |
Type | Description |
---|---|
array | An array of rows. Each element of the array is an associative array of data |

getSpreadsheets(
mixed $location
=
null
)
:
\Zend_Gdata_Spreadsheets_SpreadsheetFeed
Alias for getSpreadsheetFeed
Name | Type | Description |
---|---|---|
$location | mixed | A DocumentQuery or a string URI specifying the feed location. |
Type | Description |
---|---|
\Zend_Gdata_Spreadsheets_SpreadsheetFeed |

getStaticHttpClient(
)
:
\Zend_Http_Client
Gets the HTTP client object. If none is set, a new Zend_Http_Client will be used.
Inherited from: \Zend_Gdata_App::getStaticHttpClient()Type | Description |
---|---|
\Zend_Http_Client |

getVerboseExceptionMessages(
)
:
boolean
Get whether to use verbose exception messages
Inherited from: \Zend_Gdata_App::getVerboseExceptionMessages()In the case of HTTP errors, use the body of the HTTP response in the exception message.
Type | Description |
---|---|
boolean |

getWorksheetFeed(
mixed $location
)
:
\Zend_Gdata_Spreadsheets_WorksheetFeed
Gets a worksheet feed.
Name | Type | Description |
---|---|---|
$location | mixed | A DocumentQuery, SpreadsheetEntry, or a string URI |
Type | Description |
---|---|
\Zend_Gdata_Spreadsheets_WorksheetFeed | The feed of worksheets |

import(
string $uri, \Zend_Http_Client $client
=
null, string $className
=
Zend_Gdata_Feed
)
:
string|\Zend_Gdata_App_Feed
Name | Type | Description |
---|---|---|
$uri | string | |
$client | \Zend_Http_Client | The client used for communication |
$className | string | The class which is used as the return type |
Type | Description |
---|---|
string\Zend_Gdata_App_Feed | Returns string only if the object mapping has been disabled explicitly by passing false to the useObjectMapping() function. |
Exception | Description |
---|---|
\Zend_Gdata_App_Exception |

importFile(
string $filename, string $className
=
Zend_Gdata_App_Feed, string $useIncludePath
=
false
)
:
\Zend_Gdata_App_Feed
Imports a feed from a file located at $filename.
Inherited from: \Zend_Gdata_App::importFile()Name | Type | Description |
---|---|---|
$filename | string | |
$className | string | The class which is used as the return type |
$useIncludePath | string | Whether the include_path should be searched |
Type | Description |
---|---|
\Zend_Gdata_App_Feed |
Exception | Description |
---|---|
\Zend_Gdata_App_Exception |

importString(
string $string, string $className
=
Zend_Gdata_App_Feed, $majorProtocolVersion
=
null, $minorProtocolVersion
=
null
)
:
\Zend_Gdata_App_Feed
Name | Type | Description |
---|---|---|
$string | string | |
$className | string | The class which is used as the return type |
$majorProtocolVersion | ||
$minorProtocolVersion |
Type | Description |
---|---|
\Zend_Gdata_App_Feed |
Exception | Description |
---|---|
\Zend_Gdata_App_Exception |

importUrl(
string $url, string $className
=
Zend_Gdata_App_Feed, array $extraHeaders
=
array
)
:
string|\Zend_Gdata_App_Feed
Imports the specified URL (non-statically).
Inherited from: \Zend_Gdata_App::importUrl()Name | Type | Description |
---|---|---|
$url | string | The URL to import |
$className | string | The class which is used as the return type |
$extraHeaders | array | Extra headers to add to the request, as an array of string-based key/value pairs. |
Type | Description |
---|---|
string\Zend_Gdata_App_Feed | Returns string only if the object mapping has been disabled explicitly by passing false to the useObjectMapping() function. |
Exception | Description |
---|---|
\Zend_Gdata_App_Exception |

insertEntry(
mixed $data, string $uri, string $className
=
Zend_Gdata_App_Entry, array $extraHeaders
=
array
)
:
\Zend_Gdata_App_Entry
Inserts an entry to a given URI and returns the response as a fully formed Entry.
Inherited from: \Zend_Gdata_App::insertEntry()Name | Type | Description |
---|---|---|
$data | mixed | The Zend_Gdata_App_Entry or XML to post |
$uri | string | POST URI |
$className | string | The class of entry to be returned. |
$extraHeaders | array | Extra headers to add to the request, as an array of string-based key/value pairs. |
Type | Description |
---|---|
\Zend_Gdata_App_Entry | The entry returned by the service after insertion. |

insertRow(
array $rowData, string $key, string $wkshtId
=
default
)
:
\ListEntry
Inserts a new row with provided data.
Name | Type | Description |
---|---|---|
$rowData | array | An array of column header to row data |
$key | string | The key of the spreadsheet to modify |
$wkshtId | string | (optional) The worksheet to modify |
Type | Description |
---|---|
\ListEntry | The inserted row |

isAuthenticated(
)
:
boolean
Determines whether service object is authenticated.
Inherited from: \Zend_Gdata::isAuthenticated()Type | Description |
---|---|
boolean | True if service object is authenticated, false otherwise. |

performHttpRequest(
string $method, string $url, array $headers
=
array, string $body
=
null, string $contentType
=
null, int $remainingRedirects
=
null
)
:
\Zend_Http_Response
Performs a HTTP request using the specified method.
Inherited from: \Zend_Gdata::performHttpRequest()Overrides the definition in the parent (Zend_Gdata_App) and uses the Zend_Gdata_HttpClient functionality to filter the HTTP requests and responses.
Name | Type | Description |
---|---|---|
$method | string | The HTTP method for the request - 'GET', 'POST', 'PUT', 'DELETE' |
$url | string | The URL to which this request is being performed, or null if found in $data |
$headers | array | An associative array of HTTP headers for this request |
$body | string | The body of the HTTP request |
$contentType | string | The value for the content type of the request body |
$remainingRedirects | int | Number of redirects to follow if requests results in one |
Type | Description |
---|---|
\Zend_Http_Response | The response object |

post(
mixed $data, string $uri
=
null, $remainingRedirects
=
null, string $contentType
=
null, array $extraHeaders
=
null
)
:
\Zend_Http_Response
POST data with client object
Inherited from: \Zend_Gdata_App::post()Name | Type | Description |
---|---|---|
$data | mixed | The Zend_Gdata_App_Entry or XML to post |
$uri | string | POST URI |
$remainingRedirects | ||
$contentType | string | Content-type of the data |
$extraHeaders | array | Extra headers to add to the request, as an array of string-based key/value pairs. |
Type | Description |
---|---|
\Zend_Http_Response |
Exception | Description |
---|---|
\Zend_Gdata_App_Exception | |
\Zend_Gdata_App_HttpException | |
\Zend_Gdata_App_InvalidArgumentException |

prepareRequest(
string $method, string $url
=
null, array $headers
=
array, mixed $data
=
null, string $contentTypeOverride
=
null
)
:
array
Provides pre-processing for HTTP requests to APP services.
Inherited from: \Zend_Gdata_App::prepareRequest()Name | Type | Description |
---|---|---|
$method | string | The HTTP method for the request - 'GET', 'POST', 'PUT', 'DELETE' |
$url | string | The URL to which this request is being performed, or null if found in $data |
$headers | array | An associative array of HTTP headers for this request |
$data | mixed | The Zend_Gdata_App_Entry or XML for the body of the request |
$contentTypeOverride | string | The override value for the content type of the request body |
Type | Description |
---|---|
array | An associative array containing the determined 'method', 'url', 'data', 'headers', 'contentType' |

put(
mixed $data, string $uri
=
null, $remainingRedirects
=
null, string $contentType
=
null, array $extraHeaders
=
null
)
:
\Zend_Http_Response
PUT data with client object
Inherited from: \Zend_Gdata_App::put()Name | Type | Description |
---|---|---|
$data | mixed | The Zend_Gdata_App_Entry or XML to post |
$uri | string | PUT URI |
$remainingRedirects | ||
$contentType | string | Content-type of the data |
$extraHeaders | array | Extra headers to add to the request, as an array of string-based key/value pairs. |
Type | Description |
---|---|
\Zend_Http_Response |
Exception | Description |
---|---|
\Zend_Gdata_App_Exception | |
\Zend_Gdata_App_HttpException | |
\Zend_Gdata_App_InvalidArgumentException |

registerPackage(
string $name
)
:
void
Adds a Zend Framework package to the $_registeredPackages array.
Inherited from: \Zend_Gdata_App::registerPackage()This array is searched when using the magic __call method below to instantiante new objects.
Name | Type | Description |
---|---|---|
$name | string | The name of the package (eg Zend_Gdata_App) |

setGzipEnabled(
boolean $enabled
=
false
)
:
void
Name | Type | Description |
---|---|---|
$enabled | boolean | Whether or not to enable gzipped responses |

setHttpClient(
\Zend_Http_Client $client, $applicationId
=
MyCompany-MyApp-1.0
)
:
\Zend_Gdata_App
Set the Zend_Http_Client object used for communication
Inherited from: \Zend_Gdata_App::setHttpClient()Name | Type | Description |
---|---|---|
$client | \Zend_Http_Client | The client to use for communication |
$applicationId |
Type | Description |
---|---|
\Zend_Gdata_App | Provides a fluent interface |
Exception | Description |
---|---|
\Zend_Gdata_App_HttpException |

setHttpMethodOverride(
boolean $override
=
true
)
:
void
Toggle using POST instead of PUT and DELETE HTTP methods
Inherited from: \Zend_Gdata_App::setHttpMethodOverride()Some feed implementations do not accept PUT and DELETE HTTP methods, or they can't be used because of proxies or other measures. This allows turning on using POST where PUT and DELETE would normally be used; in addition, an X-Method-Override header will be sent with a value of PUT or DELETE as appropriate.
Name | Type | Description |
---|---|---|
$override | boolean | Whether to override PUT and DELETE with POST. |

setMajorProtocolVersion(
int $value
)
:
void
Set the major protocol version that should be used. Values < 1 will cause a Zend_Gdata_App_InvalidArgumentException to be thrown.
Inherited from: \Zend_Gdata_App::setMajorProtocolVersion()Name | Type | Description |
---|---|---|
$value | int | The major protocol version to use. |
Exception | Description |
---|---|
\Zend_Gdata_App_InvalidArgumentException |

setMaxRedirects(
int $maxRedirects
)
:
void
Set the maximum number of redirects to follow during HTTP operations
Inherited from: \Zend_Gdata_App::setMaxRedirects()Name | Type | Description |
---|---|---|
$maxRedirects | int | Maximum number of redirects to follow |

setMinorProtocolVersion(
\(int|\NULL) $value
)
:
void
Set the minor protocol version that should be used. If set to NULL, no minor protocol version will be sent to the server. Values < 0 will cause a Zend_Gdata_App_InvalidArgumentException to be thrown.
Inherited from: \Zend_Gdata_App::setMinorProtocolVersion()Name | Type | Description |
---|---|---|
$value | \(int|\NULL) | The minor protocol version to use. |
Exception | Description |
---|---|
\Zend_Gdata_App_InvalidArgumentException |

setStaticHttpClient(
\Zend_Http_Client $httpClient
)
:
void
Sets the static HTTP client object to use for retrieving the feed.
Name | Type | Description |
---|---|---|
$httpClient | \Zend_Http_Client |

setVerboseExceptionMessages(
boolean $verbose
)
:
void
Set whether to use verbose exception messages
Inherited from: \Zend_Gdata_App::setVerboseExceptionMessages()In the case of HTTP errors, use the body of the HTTP response in the exception message.
Name | Type | Description |
---|---|---|
$verbose | boolean | Whether to use verbose exception messages |

updateCell(
int $row, int $col, int $inputValue, string $key, string $wkshtId
=
default
)
:
\CellEntry
Updates an existing cell.
Name | Type | Description |
---|---|---|
$row | int | The row containing the cell to update |
$col | int | The column containing the cell to update |
$inputValue | int | The new value for the cell |
$key | string | The key for the spreadsheet to be updated |
$wkshtId | string | (optional) The worksheet to be updated |
Type | Description |
---|---|
\CellEntry | The updated cell entry. |

updateEntry(
mixed $data, string|null $uri
=
null, string|null $className
=
null, array $extraHeaders
=
array
)
:
\Zend_Gdata_App_Entry
Update an entry
Inherited from: \Zend_Gdata_App::updateEntry()Name | Type | Description |
---|---|---|
$data | mixed | Zend_Gdata_App_Entry or XML (w/ID and link rel='edit') |
$uri | string|null | The URI to send requests to, or null if $data contains the URI. |
$className | string|null | The name of the class that should be deserialized from the server response. If null, then 'Zend_Gdata_App_Entry' will be used. |
$extraHeaders | array | Extra headers to add to the request, as an array of string-based key/value pairs. |
Type | Description |
---|---|
\Zend_Gdata_App_Entry | The entry returned from the server |
Exception | Description |
---|---|
\Zend_Gdata_App_Exception |