NAME

DbFramework::PrimaryKey - Primary key class

SYNOPSIS

use DbFramework::PrimaryKey;
$pk   = new DbFramework::Primary(\@attributes);
$sql  = $pk->as_sql;
$html = $pk->html_pk_select_field(\@column_names,$multiple,\@default);

DESCRIPTION

The DbFramework::PrimaryKey class implements primary keys for a table.

SUPERCLASSES

DbFramework::Key

CLASS METHODS

new(\@attributes)

Create a new DbFramework::PrimaryKey object. @attributes is a list of DbFramework::Attribute objects from a single DbFramework::Table object which make up the key.

OBJECT METHODS

as_sql()

Returns a string which can be used in an SQL 'CREATE TABLE' statement to create the primary key.

html_select_field(\@column_names,$multiple,\@default)

Returns an HTML form field where the value consists of the values from the columns which make up the primary key and the labels consist of the corresponding values from @column_names. If $multiple is defined the field will allow multiple selections. @default is a list of values which should be selected by default.

SEE ALSO

DbFramework::Key

AUTHOR

Paul Sharpe <paul@miraclefish.com>

COPYRIGHT

Copyright (c) 1997,1998 Paul Sharpe. England. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.