public function hasIndex($columns, $unique=false)
    {
        if (!is_array($columns)) {
            $columns = array($columns);
        }
        foreach ($this->getIndexes() as $index) {
            if ($index->isUnique() == $unique and $index->getColumns() == $columns) {
                return true;
            }
        }
        return false;
    }
public function hasIndex($columns, $unique=false)
    {
        if (!is_array($columns)) {
            $columns = array($columns);
        }
        foreach ($this->getIndexes() as $index) {
            if ($index->isUnique() == $unique and $index->getColumns() == $columns) {
                return true;
            }
        }
        return false;
    }
public function hasIndex ( $ columns , $ unique = false ) { if ( ! is_array ( $ columns ) ) { $ columns = array ( $ columns ) ; } foreach ( $ this -> getIndexes ( ) as $ index ) { if ( $ index -> isUnique ( ) == $ unique and $ index -> getColumns ( ) == $ columns ) { return true ; } } return false ; }
Check for presence of index with given properties, ignoring index name

@param mixed $columns Column name or array of column names
@param bool $unique Unique index, default: false
@return bool
Check for presence of index with given properties ignoring index name