dc4c8d2de4bc1d56e0a2e2d10e9128e50872ad5c
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / CDBICompat.pm
1 package DBIx::Class::CDBICompat;
2
3 use strict;
4 use warnings;
5 use base qw/DBIx::Class::Core DBIx::Class::DB/;
6 use Carp::Clan qw/^DBIx::Class/;
7
8 eval {
9   require Class::Trigger;
10   require DBIx::ContextualFetch;
11 };
12 croak "Class::Trigger and DBIx::ContextualFetch is required for CDBICompat" if $@;
13
14 __PACKAGE__->load_own_components(qw/
15   Constraints
16   Triggers
17   ReadOnly
18   GetSet
19   LiveObjectIndex
20   AttributeAPI
21   Stringify
22   DestroyWarning
23   Constructor
24   AccessorMapping
25   ColumnCase
26   HasA
27   HasMany
28   MightHave
29   LazyLoading
30   AutoUpdate
31   TempColumns
32   Retrieve
33   Pager
34   ColumnGroups
35   ImaDBI/);
36
37             #DBIx::Class::ObjIndexStubs
38 1;
39
40 =head1 NAME 
41
42 DBIx::Class::CDBICompat - Class::DBI Compatibility layer.
43
44 =head1 SYNOPSIS
45
46   use base qw/DBIx::Class/;
47   __PACKAGE__->load_components(qw/CDBICompat Core DB/);
48
49 =head1 DESCRIPTION
50
51 DBIx::Class features a fully featured compatibility layer with L<Class::DBI>
52 to ease transition for existing CDBI users. In fact, this class is just a
53 receipe containing all the features emulated. If you like, you can choose
54 which features to emulate by building your own class and loading it like 
55 this:
56
57   __PACKAGE__->load_own_components(qw/CDBICompat/);
58
59 this will automatically load the features included in My::DB::CDBICompat, 
60 provided it looks something like this:
61
62   package My::DB::CDBICompat;
63   __PACKAGE__->load_components(qw/
64     CDBICompat::ColumnGroups
65     CDBICompat::Retrieve
66     CDBICompat::HasA
67     CDBICompat::HasMany
68     CDBICompat::MightHave
69   /);
70
71 =head1 Components
72
73 =over 4
74
75 =item AccessorMapping
76
77 =item AttributeAPI
78
79 =item AutoUpdate
80
81 Allows you to turn on automatic updates for column values.
82
83 =item ColumnCase
84
85 =item ColumnGroups
86
87 =item Constraints
88
89 =item Constructor
90
91 =item DestroyWarning
92
93 =item GetSet
94
95 =item HasA
96
97 Responsible for HasA relationships. 
98
99 =item HasMany
100
101 Responsible for HasMany relationships. 
102
103 =item ImaDBI
104
105 =item LazyLoading
106
107 =item LiveObjectIndex
108
109 The live object index tries to ensure there is only one version of a object
110 in the perl interpreter.
111
112 =item MightHave
113
114 Responsible for MightHave relationships. 
115
116 =item ObjIndexStubs
117
118 =item ReadOnly
119
120 =item Retrieve
121
122 =item Stringify
123
124 =item TempColumns
125
126 =item Triggers
127
128 This class implements the trigger functionality.
129
130 =item PassThrough
131
132 =back
133
134 =head1 AUTHORS
135
136 Matt S. Trout <mst@shadowcatsystems.co.uk>
137
138 =head1 LICENSE
139
140 You may distribute this code under the same terms as Perl itself.
141
142 =cut
143