getIndexChoices() public static method

Return a list of all index choices
public static getIndexChoices ( ) : string[]
return string[] index choices
Example #1
0
 /**
  * Returns HTML for the index choice selector
  *
  * @param boolean $edit_table whether this is table editing
  *
  * @return string HTML for the index choice selector
  */
 public function generateIndexChoiceSelector($edit_table)
 {
     $html_options = '<select name="index[Index_choice]"' . ' id="select_index_choice" ' . ($edit_table ? 'disabled="disabled"' : '') . '>';
     foreach (Index::getIndexChoices() as $each_index_choice) {
         if ($each_index_choice === 'PRIMARY' && $this->_choice !== 'PRIMARY' && 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";
     }
     $html_options .= '</select>';
     return $html_options;
 }