Add in a warning if a column is declared as TEMP but it's already declared
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / CDBICompat / Relationship.pm
CommitLineData
a9c8094b 1package
2 DBIx::Class::CDBICompat::Relationship;
3
4use strict;
5use warnings;
6
7
8=head1 NAME
9
10DBIx::Class::CDBICompat::Relationship
11
12=head1 DESCRIPTION
13
14Emulate the Class::DBI::Relationship object returned from C<meta_info()>.
15
aa11d765 16The C<args()> method does not return any useful result as it's not clear what it should contain nor if any of the information is applicable to DBIx::Class.
17
a9c8094b 18=cut
19
20my %method2key = (
21 name => 'type',
22 class => 'self_class',
23 accessor => 'accessor',
24 foreign_class => 'class',
25);
26
27sub new {
28 my($class, $args) = @_;
29
30 return bless $args, $class;
31}
32
33for my $method (keys %method2key) {
34 my $key = $method2key{$method};
35 my $code = sub {
36 $_[0]->{$key};
37 };
38
39 no strict 'refs';
40 *{$method} = $code;
41}
42
43sub args {
44 warn "args() is unlikely to ever work";
45 return undef;
46}
47
48
491;