protected function indexDefString($tablename, array $def) {
        $indexName = $this->backtick($this->buildIndexName($tablename, $def));
        switch (val('type', $def, Db::INDEX_IX)) {
            case Db::INDEX_IX:
                return "index $indexName ".$this->bracketList($def['columns'], '`');
            case Db::INDEX_UNIQUE:
                return "unique $indexName ".$this->bracketList($def['columns'], '`');
            case Db::INDEX_PK:
                return "primary key ".$this->bracketList($def['columns'], '`');
        }
        return null;
    }
protected function indexDefString($tablename, array $def) {
        $indexName = $this->backtick($this->buildIndexName($tablename, $def));
        switch (val('type', $def, Db::INDEX_IX)) {
            case Db::INDEX_IX:
                return "index $indexName ".$this->bracketList($def['columns'], '`');
            case Db::INDEX_UNIQUE:
                return "unique $indexName ".$this->bracketList($def['columns'], '`');
            case Db::INDEX_PK:
                return "primary key ".$this->bracketList($def['columns'], '`');
        }
        return null;
    }
protected function indexDefString ( $ tablename , array $ def ) { $ indexName = $ this -> backtick ( $ this -> buildIndexName ( $ tablename , $ def ) ) ; switch ( val ( 'type' , $ def , Db :: INDEX_IX ) ) { case Db :: INDEX_IX : return "index $indexName " . $ this -> bracketList ( $ def [ 'columns' ] , '`' ) ; case Db :: INDEX_UNIQUE : return "unique $indexName " . $ this -> bracketList ( $ def [ 'columns' ] , '`' ) ; case Db :: INDEX_PK : return "primary key " . $ this -> bracketList ( $ def [ 'columns' ] , '`' ) ; } return null ; }
Return the SDL string that defines an index.

@param string $tablename The name of the table that the index is on.
@param array $def The index defintion. This definition should have the following keys.

columns
: An array of columns in the index.
type
: One of "index", "unique", or "primary".
@return null|string Returns the index string or null if the index is not correct.
Return the SDL string that defines an index .