當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Table::getUiProp方法代碼示例

本文整理匯總了PHP中PMA\libraries\Table::getUiProp方法的典型用法代碼示例。如果您正苦於以下問題:PHP Table::getUiProp方法的具體用法?PHP Table::getUiProp怎麽用?PHP Table::getUiProp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PMA\libraries\Table的用法示例。


在下文中一共展示了Table::getUiProp方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: PMA_handleSortOrder

/**
 * Handle remembered sorting order, only for single table query
 *
 * @param string $db                    database name
 * @param string $table                 table name
 * @param array  &$analyzed_sql_results the analyzed query results
 * @param string &$full_sql_query       SQL query
 *
 * @return void
 */
function PMA_handleSortOrder($db, $table, &$analyzed_sql_results, &$full_sql_query)
{
    $pmatable = new Table($table, $db);
    if (empty($analyzed_sql_results['order'])) {
        // Retrieving the name of the column we should sort after.
        $sortCol = $pmatable->getUiProp(Table::PROP_SORTED_COLUMN);
        if (empty($sortCol)) {
            return;
        }
        // Remove the name of the table from the retrieved field name.
        $sortCol = str_replace(PMA\libraries\Util::backquote($table) . '.', '', $sortCol);
        // Create the new query.
        $full_sql_query = SqlParser\Utils\Query::replaceClause($analyzed_sql_results['statement'], $analyzed_sql_results['parser']->list, 'ORDER BY ' . $sortCol);
        // TODO: Avoid reparsing the query.
        $analyzed_sql_results = SqlParser\Utils\Query::getAll($full_sql_query);
    } else {
        // Store the remembered table into session.
        $pmatable->setUiProp(Table::PROP_SORTED_COLUMN, SqlParser\Utils\Query::getClause($analyzed_sql_results['statement'], $analyzed_sql_results['parser']->list, 'ORDER BY'));
    }
}
開發者ID:Devuiux,項目名稱:phpmyadmin,代碼行數:30,代碼來源:sql.lib.php

示例2: _getColumnParams

 /**
  * Get column order and column visibility
  *
  * @param array $analyzed_sql_results analyzed sql results
  *
  * @return  array           2 element array - $col_order, $col_visib
  *
  * @access  private
  *
  * @see     _getTableBody()
  */
 private function _getColumnParams($analyzed_sql_results)
 {
     if ($this->_isSelect($analyzed_sql_results)) {
         $pmatable = new Table($this->__get('table'), $this->__get('db'));
         $col_order = $pmatable->getUiProp(Table::PROP_COLUMN_ORDER);
         $col_visib = $pmatable->getUiProp(Table::PROP_COLUMN_VISIB);
     } else {
         $col_order = false;
         $col_visib = false;
     }
     return array($col_order, $col_visib);
 }
開發者ID:rugbyprof,項目名稱:phpmyadmin,代碼行數:23,代碼來源:DisplayResults.php

示例3: testSetUiProp

 /**
  * Test for setUiProp
  *
  * @return void
  */
 public function testSetUiProp()
 {
     $table_name = 'PMA_BookMark';
     $db = 'PMA';
     $table = new Table($table_name, $db);
     $property = Table::PROP_COLUMN_ORDER;
     $value = "UiProp_value";
     $table_create_time = null;
     $table->setUiProp($property, $value, $table_create_time);
     //set UI prop successfully
     $this->assertEquals($value, $table->uiprefs[$property]);
     //removeUiProp
     $table->removeUiProp($property);
     $is_define_property = isset($table->uiprefs[$property]) ? true : false;
     $this->assertEquals(false, $is_define_property);
     //getUiProp after removeUiProp
     $is_define_property = $table->getUiProp($property);
     $this->assertEquals(false, $is_define_property);
 }
開發者ID:pboutin44,項目名稱:maintest,代碼行數:24,代碼來源:TableTest.php


注:本文中的PMA\libraries\Table::getUiProp方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。