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


PHP PMA_getDisplayValueForForeignTableColumn函数代码示例

本文整理汇总了PHP中PMA_getDisplayValueForForeignTableColumn函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_getDisplayValueForForeignTableColumn函数的具体用法?PHP PMA_getDisplayValueForForeignTableColumn怎么用?PHP PMA_getDisplayValueForForeignTableColumn使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: PMA_getForeigners

  * If we are in grid editing, we need to process the relational and
  * transformed fields, if they were edited. After that, output the correct
  * link/transformed value and exit
  *
  * Logic taken from libraries/DisplayResults.class.php
  */
 if (isset($_REQUEST['rel_fields_list']) && $_REQUEST['rel_fields_list'] != '') {
     $map = PMA_getForeigners($db, $table, '', 'both');
     $relation_fields = array();
     parse_str($_REQUEST['rel_fields_list'], $relation_fields);
     // loop for each relation cell
     /** @var array $relation_fields */
     foreach ($relation_fields as $cell_index => $curr_rel_field) {
         foreach ($curr_rel_field as $relation_field => $relation_field_value) {
             $where_comparison = "='" . $relation_field_value . "'";
             $dispval = PMA_getDisplayValueForForeignTableColumn($where_comparison, $map, $relation_field);
             $extra_data['relations'][$cell_index] = PMA_getLinkForRelationalDisplayField($map, $relation_field, $where_comparison, $dispval, $relation_field_value);
         }
     }
     // end of loop for each relation cell
 }
 if (isset($_REQUEST['do_transformations']) && $_REQUEST['do_transformations'] == true) {
     $edited_values = array();
     parse_str($_REQUEST['transform_fields_list'], $edited_values);
     if (!isset($extra_data)) {
         $extra_data = array();
     }
     $transformation_types = array("input_transformation", "transformation");
     foreach ($mime_map as $transformation) {
         $column_name = $transformation['column_name'];
         foreach ($transformation_types as $type) {
开发者ID:altesien,项目名称:FinalProject,代码行数:31,代码来源:tbl_replace.php

示例2: testGetDisplayValueForForeignTableColumn

 /**
  * Test for PMA_getDisplayValueForForeignTableColumn
  *
  * @return void
  */
 public function testGetDisplayValueForForeignTableColumn()
 {
     $map = array();
     $map['f']['foreign_db'] = 'information_schema';
     $map['f']['foreign_table'] = 'TABLES';
     $map['f']['foreign_field'] = 'f';
     $dbi = $this->getMockBuilder('PMA_DatabaseInterface')->disableOriginalConstructor()->getMock();
     $dbi->expects($this->once())->method('tryQuery')->with('SELECT `TABLE_COMMENT` FROM `information_schema`.`TABLES` WHERE ' . '`f`=1', null, PMA_DatabaseInterface::QUERY_STORE)->will($this->returnValue('r1'));
     $dbi->expects($this->once())->method('numRows')->with('r1')->will($this->returnValue('2'));
     $dbi->expects($this->once())->method('fetchRow')->with('r1', 0)->will($this->returnValue(array('2')));
     $GLOBALS['dbi'] = $dbi;
     $result = PMA_getDisplayValueForForeignTableColumn("=1", null, $map, 'f');
     $this->assertEquals(2, $result);
 }
开发者ID:kfjihailong,项目名称:phpMyAdmin,代码行数:19,代码来源:PMA_insert_edit_test.php


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