NAME

DbFramework::ForeignKey - Foreign Key class

SYNOPSIS

use DbFramework::ForeignKey;
my $fk = new DbFramework::ForeignKey($name,\@attributes,$primary);
$fk->references($primary);
$sql = $fk->as_sql;

DESCRIPTION

The DbFramework::ForeignKey class implements foreign keys for a table.

SUPERCLASSES

DbFramework::Key

CLASS METHODS

new($name,\@attributes,$primary)

Returns a new DbFramework::ForeignKey object.

$name is the name of the foreign key. @attributes is a list of DbFramework::Attribute objects from a single DbFramework::Table object which make up the key. $primary is the DbFramework::Primary object which the foreign key references.

OBJECT METHODS

references($primary)

$primary should be a DbFramework::PrimaryKey object. If supplied, it sets the primary key referenced by this foreign key. Returns the DbFramework::PrimaryKey object referenced by this foreign key.

SEE ALSO

DbFramework::Key, DbFramework::PrimaryKey

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.