Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...

When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Interacting With Cell-based Feeds

In a cell-based feed, each entry represents a single cell.

Note that we don't recommend interacting with both a cell-based feed and a list-based feed for the same worksheet at the same time.

Get a Cell-based Feed

To retrieve a worksheet's cell feed, use the getCellFeed() method of the Spreadsheets service.

= new Zend_Gdata_Spreadsheets_CellQuery();
$cellFeed $spreadsheetService->getCellFeed($query);

The resulting Zend_Gdata_Spreadsheets_CellFeed object $cellFeed represents a response from the server. Among other things, this feed contains an array of Zend_Gdata_Spreadsheets_CellEntry objects ($cellFeed>entries), each of which represents a single cell in a worksheet. You can display this information:

foreach($cellFeed as $cellEntry) {
$row $cellEntry->cell->getRow();
$col $cellEntry->cell->getColumn();
$val $cellEntry->cell->getText();
"$row$col = $val\n";

Send a Cell Range Query

Suppose you wanted to retrieve the cells in the first column of a worksheet. You can request a cell feed containing only this column as follows:

= new Zend_Gdata_Spreadsheets_CellQuery();
$feed $spreadsheetService->getCellsFeed($query);

This requests all the data in column 1, starting with row 2.

Change Contents of a Cell

To modify the contents of a cell, call updateCell() with the row, column, and new value of the cell.


The new data is placed in the specified cell in the worksheet. If the specified cell contains data already, it will be overwritten. Note: Use updateCell() to change the data in a cell, even if the cell is empty.

Zend Framework