本文整理汇总了PHP中Zend_Gdata_Spreadsheets::getCellFeed方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Gdata_Spreadsheets::getCellFeed方法的具体用法?PHP Zend_Gdata_Spreadsheets::getCellFeed怎么用?PHP Zend_Gdata_Spreadsheets::getCellFeed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Gdata_Spreadsheets
的用法示例。
在下文中一共展示了Zend_Gdata_Spreadsheets::getCellFeed方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getColumns
public function getColumns()
{
$query = new Zend_Gdata_Spreadsheets_CellQuery();
$query->setSpreadsheetKey($this->spreadsheetId);
$feed = $currentWorksheet = $this->spreadsheetService->getCellFeed($query);
$columns = array();
$columnCount = intval($feed->getColumnCount()->getText());
for ($i = 0; $i < $columnCount; $i++) {
if ($feed->entries[$i]) {
$columns[$i] = $feed->entries[$i]->getCell()->getText();
}
}
return $columns;
}
示例2:
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
/**
* @see Zend_Gdata_Spreadsheets
*/
Zend_Loader::loadClass('Zend_Gdata_Spreadsheets');
$authService = Zend_Gdata_Spreadsheets::AUTH_SERVICE_NAME;
$httpClient = Zend_Gdata_ClientLogin::getHttpClient('ifuyivara@gmail.com', 'internet21', $authService);
$gdClient = new Zend_Gdata_Spreadsheets($httpClient);
$query = new Zend_Gdata_Spreadsheets_CellQuery();
$query->setSpreadsheetKey('0AlkFQsJI6D_7dEZOVXlTeDNYOGsyNVNWalNLdWdDU2c');
$query->setWorksheetId(3);
$query->setMinCol(3);
$query->setMaxCol(3);
$query->setMinRow(17);
$query->setMaxRow(17);
$feed = $gdClient->getCellFeed($query);
$entry = $gdClient->updateCell(16, 4, $_GET['precio'], '0AlkFQsJI6D_7dEZOVXlTeDNYOGsyNVNWalNLdWdDU2c', 3);
$entry = $gdClient->updateCell(17, 4, $_GET['enganche'], '0AlkFQsJI6D_7dEZOVXlTeDNYOGsyNVNWalNLdWdDU2c', 3);
$entry = $gdClient->updateCell(13, 9, $_GET['anio'], '0AlkFQsJI6D_7dEZOVXlTeDNYOGsyNVNWalNLdWdDU2c', 3);
$entry = $gdClient->updateCell(13, 3, $_GET['marca'], '0AlkFQsJI6D_7dEZOVXlTeDNYOGsyNVNWalNLdWdDU2c', 3);
$entry = $gdClient->updateCell(14, 3, $_GET['linea'], '0AlkFQsJI6D_7dEZOVXlTeDNYOGsyNVNWalNLdWdDU2c', 3);
$i = 0;
foreach ($feed->entries as $entry) {
if ($entry instanceof Zend_Gdata_Spreadsheets_CellEntry) {
print "<div class=\"calc-item\"><label>Monto del enganche:</label> " . number_format($entry->content->text, 2) . "</div>";
}
$i++;
}
$query->setMinCol(5);
$query->setMaxCol(5);
$query->setMinRow(17);
示例3: gdata_import
function gdata_import($attrib)
{
if ($attrib["key"] == "" || $attrib["worksheet"] == "" || $attrib["user"] == "" || $attrib["pass"] == "") {
echo 'ERROR: SET ALL ATTRIBUTES i.e sheet, worksheet, user, pass and columns. ';
return;
}
// load Zend Gdata libraries
set_include_path(get_include_path() . PATH_SEPARATOR . WP_PLUGIN_DIR . "//gdata-importer//");
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata_Spreadsheets');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
// set credentials for ClientLogin authentication
$user = $attrib["user"];
$pass = $attrib["pass"];
try {
// connect to API
$service = Zend_Gdata_Spreadsheets::AUTH_SERVICE_NAME;
$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service);
$service = new Zend_Gdata_Spreadsheets($client);
// get spreadsheet entry
$ssEntry = $service->getSpreadsheetEntry('https://spreadsheets.google.com/feeds/spreadsheets/' . $attrib["key"]);
// get worksheets in this spreadsheet
$wsFeed = $ssEntry->getWorksheets($attrib["worksheet"]);
} catch (Exception $e) {
echo 'ERROR: ' . $e->getMessage();
return;
}
$content = <<<HTML
\t<table>
HTML;
foreach ($wsFeed as $wsEntry) {
if ($wsEntry->getTitle() == $attrib["worksheet"]) {
//get title
$query = new Zend_Gdata_Spreadsheets_CellQuery();
$query->setSpreadsheetKey($attrib["key"]);
$id = $wsEntry->getId();
$arr = explode('/', $id);
$query->setWorksheetId($arr[sizeof($arr) - 1]);
$query->setMinRow(1);
$query->setMaxRow(1);
$cellFeed = $service->getCellFeed($query);
$content = $content . "<tr>";
foreach ($cellFeed as $cellEntry) {
$content = $content . "<td>" . $cellEntry->getCell()->getText() . "</td>";
}
$content = $content . "</tr>";
//get content
$rows = $wsEntry->getContentsAsRows();
foreach ($rows as $row) {
$content = $content . "<tr>";
foreach ($row as $key => $value) {
$content = $content . "<td>" . $value . "</td>";
}
$content = $content . "</tr>";
}
}
}
$content = $content . <<<HTML
\t\t</tbody>
\t</table>
HTML;
return $content;
}