本文整理汇总了PHP中PMA_Index::getIndexChoices方法的典型用法代码示例。如果您正苦于以下问题:PHP PMA_Index::getIndexChoices方法的具体用法?PHP PMA_Index::getIndexChoices怎么用?PHP PMA_Index::getIndexChoices使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PMA_Index
的用法示例。
在下文中一共展示了PMA_Index::getIndexChoices方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateIndexSelector
public function generateIndexSelector()
{
$html_options = '';
foreach (PMA_Index::getIndexChoices() as $each_index_choice) {
if ($each_index_choice === 'PRIMARY' && $this->_choice !== 'PRIMARY' && PMA_Index::getPrimary($this->_table, $this->_schema)) {
// skip PRIMARY if there is already one in the table
continue;
}
$html_options .= '<option value="' . $each_index_choice . '"' . ($this->_choice == $each_index_choice ? ' selected="selected"' : '') . '>' . $each_index_choice . '</option>' . "\n";
}
return $html_options;
}
示例2: testGetIndexChoices
/**
* Test for getIndexChoices
*
* @return void
*/
public function testGetIndexChoices()
{
$index_choices = PMA_Index::getIndexChoices();
$this->assertEquals(5, count($index_choices));
$this->assertEquals('PRIMARY,INDEX,UNIQUE,SPATIAL,FULLTEXT', implode(",", $index_choices));
}