protected function findPrimaryKeyIndex(array $indexes) {
        foreach ($indexes as $index) {
            if ($index['type'] === Db::INDEX_PK) {
                return $index;
            }
        }
        return null;
    }
protected function findPrimaryKeyIndex(array $indexes) {
        foreach ($indexes as $index) {
            if ($index['type'] === Db::INDEX_PK) {
                return $index;
            }
        }
        return null;
    }
protected function findPrimaryKeyIndex ( array $ indexes ) { foreach ( $ indexes as $ index ) { if ( $ index [ 'type' ] === Db :: INDEX_PK ) { return $ index ; } } return null ; }
Find the primary key in an array of indexes.

@param array $indexes The indexes to search.
@return array|null Returns the primary key or **null** if there isn't one.
Find the primary key in an array of indexes .