[Bast-commits] r4514 - DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual
wdh at dev.catalyst.perl.org
wdh at dev.catalyst.perl.org
Wed Jun 25 11:52:31 BST 2008
Author: wdh
Date: 2008-06-25 11:52:30 +0100 (Wed, 25 Jun 2008)
New Revision: 4514
Modified:
DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Cookbook.pod
Log:
clarify that ->resultset_class must be called after ->load_components and ->table when using custom resultsets
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Cookbook.pod
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Cookbook.pod 2008-06-25 09:01:58 UTC (rev 4513)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Cookbook.pod 2008-06-25 10:52:30 UTC (rev 4514)
@@ -255,8 +255,15 @@
To use your resultset, first tell DBIx::Class to create an instance of it
for you, in your My::DBIC::Schema::CD class:
+ # class definition as normal
+ __PACKAGE__->load_components(qw/ Core /);
+ __PACKAGE__->table('cd');
+
+ # tell DBIC to use the custom ResultSet class
__PACKAGE__->resultset_class('My::DBIC::ResultSet::CD');
+Note that C<resultset_class> must be called after C<load_components> and C<table>, or you will get errors about missing methods.
+
Then call your new method in your code:
my $ordered_cds = $schema->resultset('CD')->search_cds_ordered();
More information about the Bast-commits
mailing list