diff options
author | erwin <erwin@FreeBSD.org> | 2004-04-08 23:58:14 +0800 |
---|---|---|
committer | erwin <erwin@FreeBSD.org> | 2004-04-08 23:58:14 +0800 |
commit | 0cdaa5d2e4e822a2b4c618fab60afe926ae5f5ea (patch) | |
tree | ff896c2c7b9c1a260acb3c3da0411da31902b3bf /databases/p5-Class-DBI-Loader-Relationship/files | |
parent | e1e90b70eb61cadb43a04e618ff3b48bc14abef2 (diff) | |
download | freebsd-ports-gnome-0cdaa5d2e4e822a2b4c618fab60afe926ae5f5ea.tar.gz freebsd-ports-gnome-0cdaa5d2e4e822a2b4c618fab60afe926ae5f5ea.tar.zst freebsd-ports-gnome-0cdaa5d2e4e822a2b4c618fab60afe926ae5f5ea.zip |
Add p5-Class-DBI-Loader-Relationship 1.2, easier relationship
specification in CDBI::L.
This module acts as a mix-in, adding the relationship method to
Class::DBI::Loader. Since Class::DBI::Loader knows how to map between
table names and class names, there ought to be no need to replicate
the names. In addition, it is common (but not universal) to want
reverse relationships defined for has-many relationships, and for
has-a relationships to be defined for the linkages surrounding a
many-to-many table.
WWW: http://search.cpan.org/dist/Class-DBI-Loader-Relationship/
PR: ports/65176
Submitted by: Lars Thegler <lars@thegler.dk>
Diffstat (limited to 'databases/p5-Class-DBI-Loader-Relationship/files')
-rw-r--r-- | databases/p5-Class-DBI-Loader-Relationship/files/500503-Relationship.pm | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/databases/p5-Class-DBI-Loader-Relationship/files/500503-Relationship.pm b/databases/p5-Class-DBI-Loader-Relationship/files/500503-Relationship.pm new file mode 100644 index 000000000000..29af7047dbb8 --- /dev/null +++ b/databases/p5-Class-DBI-Loader-Relationship/files/500503-Relationship.pm @@ -0,0 +1,33 @@ +--- Relationship.pm.orig Mon Mar 1 16:48:45 2004 ++++ Relationship.pm Sun Apr 4 22:30:41 2004 +@@ -1,9 +1,8 @@ + package Class::DBI::Loader::Relationship; +-use 5.006; + use strict; +-use warnings; +-our $VERSION = '1.2'; +-our $DEBUG = 0; ++use vars qw($VERSION $DEBUG); ++$VERSION = '1.2'; ++$DEBUG = 0; + + 1; + +@@ -82,7 +81,7 @@ + "$via_c->has_a(".to_S($to)." => $to_c)\n". + "$from_c->$method($mapper => [ $via_c => ".to_S($to)." ])\n". + "$to_c->has_many(".to_PL($from)." => [ $via_c => ".to_S($from)." ])\n" +- if $DEBUG; ++ if $Class::DBI::Loader::Relationship::DEBUG; + + $via_c->has_a(to_S($from) => $from_c); + $via_c->has_a(to_S($to) => $to_c); +@@ -92,7 +91,7 @@ + } + return "$from_c->$method($mapper => $to_c);\n". + ($method ne "has_a" && "$to_c->has_a(".to_S($from)." => $from_c);\n") +- if $DEBUG; ++ if $Class::DBI::Loader::Relationship::DEBUG; + $from_c->$method($mapper => $to_c); + $to_c->has_a(to_S($from) => $from_c) unless $method eq "has_a"; + } |