[Bast-commits] r4912 - DBIx-Class/0.08/trunk/lib/DBIx
castaway at dev.catalyst.perl.org
castaway at dev.catalyst.perl.org
Sat Oct 11 15:56:14 BST 2008
Author: castaway
Date: 2008-10-11 15:56:14 +0100 (Sat, 11 Oct 2008)
New Revision: 4912
Modified:
DBIx-Class/0.08/trunk/lib/DBIx/Class.pm
Log:
Modernise docs
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class.pm 2008-10-09 11:47:39 UTC (rev 4911)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class.pm 2008-10-11 14:56:14 UTC (rev 4912)
@@ -68,28 +68,28 @@
package MyDB::Schema;
use base qw/DBIx::Class::Schema/;
- __PACKAGE__->load_classes();
+ __PACKAGE__->load_namespaces();
1;
Create a table class to represent artists, who have many CDs, in
-MyDB/Schema/Artist.pm:
+MyDB/Schema/Result/Artist.pm:
- package MyDB::Schema::Artist;
+ package MyDB::Schema::Result::Artist;
use base qw/DBIx::Class/;
__PACKAGE__->load_components(qw/Core/);
__PACKAGE__->table('artist');
__PACKAGE__->add_columns(qw/ artistid name /);
__PACKAGE__->set_primary_key('artistid');
- __PACKAGE__->has_many(cds => 'MyDB::Schema::CD');
+ __PACKAGE__->has_many(cds => 'MyDB::Schema::Result::CD');
1;
A table class to represent a CD, which belongs to an artist, in
-MyDB/Schema/CD.pm:
+MyDB/Schema/Result/CD.pm:
- package MyDB::Schema::CD;
+ package MyDB::Schema::Result::CD;
use base qw/DBIx::Class/;
__PACKAGE__->load_components(qw/Core/);
@@ -121,7 +121,7 @@
# Execute a joined query to get the cds.
my @all_john_cds = $johns_rs->search_related('cds')->all;
- # Fetch only the next row.
+ # Fetch the next available row.
my $first_john = $johns_rs->next;
# Specify ORDER BY on the query.
More information about the Bast-commits
mailing list