Emulate $CDBI::Weaken_Not_Available and CDBI::Plugin::NoCache
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / CDBICompat.pm
index 750b19c..49988c9 100644 (file)
@@ -22,9 +22,7 @@ __PACKAGE__->load_own_components(qw/
   Constructor
   AccessorMapping
   ColumnCase
-  HasA
-  HasMany
-  MightHave
+  Relationships
   Copy
   LazyLoading
   AutoUpdate
@@ -33,6 +31,7 @@ __PACKAGE__->load_own_components(qw/
   Retrieve
   Pager
   ColumnGroups
+  ColumnsAsHash
   AbstractSearch
   ImaDBI
   Iterator
@@ -73,86 +72,59 @@ provided it looks something like this:
     CDBICompat::MightHave
   /);
 
-=head1 COMPONENTS
 
-=over 4
-
-=item AccessorMapping
-
-=item AbstractSearch
-
-Compatibility with Class::DBI::AbstractSearch.
-
-=item AttributeAPI
-
-=item AutoUpdate
-
-Allows you to turn on automatic updates for column values.
-
-=item ColumnCase
-
-=item ColumnGroups
-
-=item Constraints
-
-=item Constructor
-
-=item DestroyWarning
-
-=item GetSet
-
-=item HasA
-
-=item HasMany
-
-=item ImaDBI
-
-=item LazyLoading
-
-=item LiveObjectIndex
+=head1 LIMITATIONS
 
-The live object index tries to ensure there is only one version of a object
-in the perl interpreter.
+=head2 Unimplemented
 
-=item MightHave
+The following methods and classes are not emulated, maybe in the future.
 
-=item ObjIndexStubs
+=over 4
 
-=item ReadOnly
+=item Class::DBI::Query
 
-=item Retrieve
+Deprecated in Class::DBI.
 
-=item Stringify
+=item Class::DBI::Column
 
-=item TempColumns
+Not documented in Class::DBI.  CDBICompat's columns() returns a plain string, not an object.
 
-=item Triggers
+=item data_type()
 
-=item PassThrough
+Undocumented CDBI method.
 
 =back
 
-=head1 LIMITATIONS
+=head2 Limited Support
 
-The following methods and classes are not emulated, maybe in the future.
+The following elements of Class::DBI have limited support.
 
 =over 4
 
-=item Class::DBI::Query
+=item Class::DBI::Relationship
 
-Deprecated in Class::DBI.
+The semi-documented Class::DBI::Relationship objects returned by C<meta_info($type, $col)> are mostly emulated except for their C<args> method.
 
-=item Class::DBI::Column
+=item Relationships
 
-Not documented in Class::DBI.  CDBICompat's columns() returns a plain string, not an object.
+Relationships between tables (has_a, has_many...) must be delcared after all tables in the relationship have been declared.  Thus the usual CDBI idiom of declaring columns and relationships for each class together will not work.  They must instead be done like so:
 
-=item data_type()
+    package Foo;
+    use base qw(Class::DBI);
+    
+    Foo->table("foo");
+    Foo->columns( All => qw(this that bar) );
 
-Undocumented CDBI method.
+    package Bar;
+    use base qw(Class::DBI);
+    
+    Bar->table("bar");
+    Bar->columns( All => qw(up down) );
 
-=item meta_info()
+    # Now that Foo and Bar are declared it is safe to declare a
+    # relationship between them
+    Foo->has_a( bar => "Bar" );
 
-Undocumented CDBI method.
 
 =back