本文整理汇总了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'));
}
}
示例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);
}
示例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);
}