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


PHP Row::renameColumn方法代码示例

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


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

示例1: test_renameColumn_shouldDoNothing_IfGivenColumnDoesNotExist

 public function test_renameColumn_shouldDoNothing_IfGivenColumnDoesNotExist()
 {
     $this->row->setColumn('nb_visits', 11);
     $this->row->renameColumn('nb_hits', 'nb_pageviews');
     $this->assertFalse($this->row->hasColumn('nb_hits'));
     $this->assertFalse($this->row->hasColumn('nb_pageviews'));
     $this->assertEquals(11, $this->row->getColumn('nb_visits'));
 }
开发者ID:cemo,项目名称:piwik,代码行数:8,代码来源:RowTest.php

示例2: renameColumn

 /**
  * Rename a column in every row. This change is applied recursively to all subtables.
  *
  * @param string $oldName Old column name.
  * @param string $newName New column name.
  */
 public function renameColumn($oldName, $newName)
 {
     foreach ($this->rows as $row) {
         $row->renameColumn($oldName, $newName);
         $subTable = $row->getSubtable();
         if ($subTable) {
             $subTable->renameColumn($oldName, $newName);
         }
     }
     if (!is_null($this->summaryRow)) {
         $this->summaryRow->renameColumn($oldName, $newName);
     }
 }
开发者ID:piwik,项目名称:piwik,代码行数:19,代码来源:DataTable.php

示例3: renameColumn

 /**
  * Rename a column in every row. This change is applied recursively to all subtables.
  *
  * @param string $oldName Old column name.
  * @param string $newName New column name.
  */
 public function renameColumn($oldName, $newName, $doRenameColumnsOfSubTables = true)
 {
     foreach ($this->getRows() as $row) {
         $row->renameColumn($oldName, $newName);
         if ($doRenameColumnsOfSubTables) {
             if (($idSubDataTable = $row->getIdSubDataTable()) !== null) {
                 Manager::getInstance()->getTable($idSubDataTable)->renameColumn($oldName, $newName);
             }
         }
     }
     if (!is_null($this->summaryRow)) {
         $this->summaryRow->renameColumn($oldName, $newName);
     }
 }
开发者ID:brienomatty,项目名称:elmsln,代码行数:20,代码来源:DataTable.php


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