After 5e0eea35 we can actually test for cleaned namespaces within CDBI
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / CDBICompat / Relationship.pm
CommitLineData
a9c8094b 1package
2 DBIx::Class::CDBICompat::Relationship;
3
4use strict;
5use warnings;
5e0eea35 6
7use base 'DBIx::Class';
8d73fcd4 8
9use DBIx::Class::_Util 'quote_sub';
51ec0382 10use namespace::clean;
a9c8094b 11
12=head1 NAME
13
b24d86a1 14DBIx::Class::CDBICompat::Relationship - Emulate the Class::DBI::Relationship object returned from meta_info()
a9c8094b 15
16=head1 DESCRIPTION
17
18Emulate the Class::DBI::Relationship object returned from C<meta_info()>.
19
20=cut
21
22my %method2key = (
23 name => 'type',
24 class => 'self_class',
25 accessor => 'accessor',
26 foreign_class => 'class',
1097f5e4 27 args => 'args',
a9c8094b 28);
29
8d73fcd4 30quote_sub __PACKAGE__ . "::$_" => "\$_[0]->{$method2key{$_}}"
31 for keys %method2key;
32
a9c8094b 33sub new {
34 my($class, $args) = @_;
d4daee7b 35
a9c8094b 36 return bless $args, $class;
37}
38
a2bd3796 39=head1 FURTHER QUESTIONS?
40
41Check the list of L<additional DBIC resources|DBIx::Class/GETTING HELP/SUPPORT>.
42
43=head1 COPYRIGHT AND LICENSE
44
45This module is free software L<copyright|DBIx::Class/COPYRIGHT AND LICENSE>
46by the L<DBIx::Class (DBIC) authors|DBIx::Class/AUTHORS>. You can
47redistribute it and/or modify it under the same terms as the
48L<DBIx::Class library|DBIx::Class/COPYRIGHT AND LICENSE>.
49
50=cut
51
a9c8094b 521;