Migrations\View\Helper\MigrationHelper::indexes PHP Method

indexes() public method

Returns an array of indexes for a given table
public indexes ( string $table ) : array
$table string Name of the table to retrieve indexes for
return array
    public function indexes($table)
    {
        $tableSchema = $table;
        if (!$table instanceof Table) {
            $tableSchema = $this->schema($table);
        }
        $tableIndexes = $tableSchema->indexes();
        $indexes = [];
        if (!empty($tableIndexes)) {
            foreach ($tableIndexes as $name) {
                $indexes[$name] = $tableSchema->index($name);
            }
        }
        return $indexes;
    }