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


PHP Row::setMetadata方法代码示例

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


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

示例1: addRowWithMetadata

 private function addRowWithMetadata($metadata)
 {
     $row = new Row(array(Row::COLUMNS => array('label' => 'val1')));
     foreach ($metadata as $name => $value) {
         $row->setMetadata($name, $value);
     }
     $this->table->addRow($row);
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:8,代码来源:PrependSegmentFilterTest.php

示例2: buildRowWithMetadata

 private function buildRowWithMetadata($metadata)
 {
     $row = new Row(array(Row::COLUMNS => array('label' => 'val1')));
     foreach ($metadata as $name => $value) {
         $row->setMetadata($name, $value);
     }
     return $row;
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:8,代码来源:ColumnCallbackDeleteMetadataTest.php

示例3: flattenRow

 /**
  * @param Row $row
  * @param DataTable $dataTable
  * @param string $labelPrefix
  * @param bool $parentLogo
  */
 private function flattenRow(Row $row, DataTable $dataTable, $labelPrefix = '', $parentLogo = false)
 {
     $label = $row->getColumn('label');
     if ($label !== false) {
         $label = trim($label);
         if (substr($label, 0, 1) == '/' && $this->recursiveLabelSeparator == '/') {
             $label = substr($label, 1);
         }
         $label = $labelPrefix . $label;
         $row->setColumn('label', $label);
     }
     $logo = $row->getMetadata('logo');
     if ($logo === false && $parentLogo !== false) {
         $logo = $parentLogo;
         $row->setMetadata('logo', $logo);
     }
     $subTable = $this->loadSubtable($dataTable, $row);
     $row->removeSubtable();
     if ($subTable === null) {
         if ($this->includeAggregateRows) {
             $row->setMetadata('is_aggregate', 0);
         }
         $dataTable->addRow($row);
     } else {
         if ($this->includeAggregateRows) {
             $row->setMetadata('is_aggregate', 1);
             $dataTable->addRow($row);
         }
         $prefix = $label . $this->recursiveLabelSeparator;
         foreach ($subTable->getRows() as $row) {
             $this->flattenRow($row, $dataTable, $prefix, $logo);
         }
     }
 }
开发者ID:josl,项目名称:CGE-File-Sharing,代码行数:40,代码来源:Flattener.php

示例4: getCompetitionDatatable

 /**
  * Returns a custom data table.
  * This data table will be converted to all available formats
  * when requested in the API request.
  *
  * @return DataTable
  */
 public function getCompetitionDatatable()
 {
     $dataTable = new DataTable();
     $row1 = new Row();
     $row1->setColumns(array('name' => 'piwik', 'license' => 'GPL'));
     // Rows Metadata is useful to store non stats data for example (logos, urls, etc.)
     // When printed out, they are simply merged with columns
     $row1->setMetadata('logo', 'logo.png');
     $dataTable->addRow($row1);
     $dataTable->addRowFromSimpleArray(array('name' => 'google analytics', 'license' => 'commercial'));
     return $dataTable;
 }
开发者ID:KiwiJuicer,项目名称:handball-dachau,代码行数:19,代码来源:API.php

示例5: setElementToReplace

 /**
  * @param Row $row
  * @param string $metadataToFilter
  * @param mixed $newValue
  */
 protected function setElementToReplace($row, $metadataToFilter, $newValue)
 {
     $row->setMetadata($metadataToFilter, $newValue);
 }
开发者ID:carriercomm,项目名称:piwik,代码行数:9,代码来源:MetadataCallbackReplace.php

示例6: flattenRow

 /**
  * @param Row $row
  * @param DataTable $dataTable
  * @param string $labelPrefix
  * @param bool $parentLogo
  */
 private function flattenRow(Row $row, $rowId, DataTable $dataTable, $labelPrefix = '', $parentLogo = false)
 {
     $label = $row->getColumn('label');
     if ($label !== false) {
         $label = trim($label);
         if ($this->recursiveLabelSeparator == '/') {
             if (substr($label, 0, 1) == '/') {
                 $label = substr($label, 1);
             } elseif ($rowId === DataTable::ID_SUMMARY_ROW && $labelPrefix && $label != DataTable::LABEL_SUMMARY_ROW) {
                 $label = ' - ' . $label;
             }
         }
         $label = $labelPrefix . $label;
         $row->setColumn('label', $label);
     }
     $logo = $row->getMetadata('logo');
     if ($logo === false && $parentLogo !== false) {
         $logo = $parentLogo;
         $row->setMetadata('logo', $logo);
     }
     /** @var DataTable $subTable */
     $subTable = $row->getSubtable();
     if ($subTable) {
         $subTable->applyQueuedFilters();
         $row->deleteMetadata('idsubdatatable_in_db');
     } else {
         $subTable = $this->loadSubtable($dataTable, $row);
     }
     $row->removeSubtable();
     if ($subTable === null) {
         if ($this->includeAggregateRows) {
             $row->setMetadata('is_aggregate', 0);
         }
         $dataTable->addRow($row);
     } else {
         if ($this->includeAggregateRows) {
             $row->setMetadata('is_aggregate', 1);
             $dataTable->addRow($row);
         }
         $prefix = $label . $this->recursiveLabelSeparator;
         $this->flattenDataTableInto($subTable, $dataTable, $prefix, $logo);
     }
 }
开发者ID:piwik,项目名称:piwik,代码行数:49,代码来源:Flattener.php

示例7: assertMetadataSavesValue

 private function assertMetadataSavesValue($expectedValue, $metadataName, $valueToSet)
 {
     $this->row->setMetadata($metadataName, $valueToSet);
     $this->assertSame($expectedValue, $this->row->getMetadata($metadataName));
 }
开发者ID:cemo,项目名称:piwik,代码行数:5,代码来源:RowTest.php


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