From: Jess Robinson Date: Wed, 16 Apr 2008 20:57:22 +0000 (+0000) Subject: Documentation updates from omega, carbon X-Git-Tag: v0.08240~488 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2f0790c43209011e3524dd6edc2aa3fc9913ef76;p=dbsrgits%2FDBIx-Class.git Documentation updates from omega, carbon --- diff --git a/lib/DBIx/Class/Manual/Intro.pod b/lib/DBIx/Class/Manual/Intro.pod index 974efe5..4bd95d5 100644 --- a/lib/DBIx/Class/Manual/Intro.pod +++ b/lib/DBIx/Class/Manual/Intro.pod @@ -13,14 +13,16 @@ better way? You've come to the right place. Here are a few simple tips that will help you get your bearings with DBIx::Class. -=head2 Tables become ResultSources +=head2 Tables become Result classes -DBIx::Class needs to know what your Table structure looks like. You do that by -defining Ls. Each table gets a ResultSource, which -defines the Columns it has, along with any Relationships it has to other tables. -(And oh, so much more besides) The important thing to understand: +DBIx::Class needs to know what your Table structure looks like. You +do that by defining Result classes. Result classes are defined by +calling methods proxied to L. Each Result +class defines one Table, which defines the Columns it has, along with +any Relationships it has to other tables. (And oh, so much more +besides) The important thing to understand: - A ResultSource == Table + A Result class == Table (most of the time, but just bear with my simplification) @@ -62,6 +64,11 @@ The important thing to understand: Setting up a ResultSet does not execute the query; retrieving the data does. +=head2 Search results are returned as Rows + +Rows of the search from the database are blessed into +L objects. + =head1 SETTING UP DBIx::Class Let's look at how you can set and use your first native L tree. diff --git a/lib/DBIx/Class/Relationship.pm b/lib/DBIx/Class/Relationship.pm index 3ee93ff..9edd7af 100644 --- a/lib/DBIx/Class/Relationship.pm +++ b/lib/DBIx/Class/Relationship.pm @@ -60,6 +60,7 @@ this: my $fred = $schema->resultset('Author')->find({ Name => 'Fred' }); my $fredsbooks = $schema->resultset('Book')->search({ Author => $fred->ID }); + With a has_many relationship called "books" on Author (see below for details), we can do this instead: diff --git a/lib/DBIx/Class/Storage.pm b/lib/DBIx/Class/Storage.pm index c8f48ef..dd61ba0 100644 --- a/lib/DBIx/Class/Storage.pm +++ b/lib/DBIx/Class/Storage.pm @@ -469,7 +469,8 @@ Old name for DBIC_TRACE =head1 SEE ALSO -L - reference storage inplementation using SQL::Abstract and DBI. +L - reference storage implementation using +SQL::Abstract and DBI. =head1 AUTHORS