当前位置: 首页>>代码示例>>PHP>>正文


PHP Piwik_DataTable::getFirstRow方法代码示例

本文整理汇总了PHP中Piwik_DataTable::getFirstRow方法的典型用法代码示例。如果您正苦于以下问题:PHP Piwik_DataTable::getFirstRow方法的具体用法?PHP Piwik_DataTable::getFirstRow怎么用?PHP Piwik_DataTable::getFirstRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Piwik_DataTable的用法示例。


在下文中一共展示了Piwik_DataTable::getFirstRow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getColumnsToDisplay

 /**
  * Returns columns names to display, in order.
  * If no columns were specified to be displayed, return all columns found in the first row.
  * @param array PHP array conversion of the data table
  * @return array
  */
 public function getColumnsToDisplay()
 {
     if (empty($this->columnsToDisplay)) {
         return array_keys($this->dataTable->getFirstRow()->getColumns());
     }
     $this->columnsToDisplay = array_filter($this->columnsToDisplay);
     return $this->columnsToDisplay;
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:14,代码来源:ViewDataTable.php

示例2: getRenderedDataTable

 /**
  * Apply the specified renderer to the DataTable
  * 
  * @param Piwik_DataTable  $dataTable
  * @return string
  */
 protected function getRenderedDataTable($dataTable)
 {
     $format = strtolower($this->outputFormat);
     // if asked for original dataStructure
     if ($format == 'original') {
         // if the original dataStructure is a simpleDataTable
         // and has only one column, we return the value
         if ($dataTable instanceof Piwik_DataTable_Simple) {
             $columns = $dataTable->getFirstRow()->getColumns();
             if (count($columns) == 1) {
                 $values = array_values($columns);
                 return $values[0];
             }
         }
         // by default "original" data is not serialized
         if ($this->caseRendererPHPSerialize($defaultSerialize = 0)) {
             $dataTable = serialize($dataTable);
         }
         return $dataTable;
     }
     $method = Piwik_Common::getRequestVar('method', '', 'string', $this->request);
     $renderer = Piwik_DataTable_Renderer::factory($format);
     $renderer->setTable($dataTable);
     $renderer->setRenderSubTables(Piwik_Common::getRequestVar('expanded', false, 'int', $this->request));
     $renderer->setHideIdSubDatableFromResponse(Piwik_Common::getRequestVar('hideIdSubDatable', false, 'int', $this->request));
     if ($format == 'php') {
         $renderer->setSerialize($this->caseRendererPHPSerialize());
         $renderer->setPrettyDisplay(Piwik_Common::getRequestVar('prettyDisplay', false, 'int', $this->request));
     } else {
         if ($format == 'html') {
             $renderer->setTableId($this->request['method']);
         } else {
             if ($format == 'csv' || $format == 'tsv') {
                 $renderer->setConvertToUnicode(Piwik_Common::getRequestVar('convertToUnicode', true, 'int', $this->request));
             }
         }
     }
     // prepare translation of column names
     if ($format == 'html' || $format == 'csv' || $format == 'tsv' || ($format = 'rss')) {
         $renderer->setApiMethod($method);
         $renderer->setIdSite(Piwik_Common::getRequestVar('idSite', false, 'int', $this->request));
         $renderer->setTranslateColumnNames(Piwik_Common::getRequestVar('translateColumnNames', false, 'int', $this->request));
     }
     return $renderer->render();
 }
开发者ID:nomoto-ubicast,项目名称:piwik,代码行数:51,代码来源:ResponseBuilder.php


注:本文中的Piwik_DataTable::getFirstRow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。