[Catalyst-commits] r12430 - trunk/examples/CatalystAdvent/root/2009/pen

jester at dev.catalyst.perl.org jester at dev.catalyst.perl.org
Fri Dec 18 19:28:14 GMT 2009


Author: jester
Date: 2009-12-18 19:28:13 +0000 (Fri, 18 Dec 2009)
New Revision: 12430

Modified:
   trunk/examples/CatalystAdvent/root/2009/pen/dbic-helpers.pod
Log:
light edits to dbic-helpers Advent

Modified: trunk/examples/CatalystAdvent/root/2009/pen/dbic-helpers.pod
===================================================================
--- trunk/examples/CatalystAdvent/root/2009/pen/dbic-helpers.pod	2009-12-18 14:21:46 UTC (rev 12429)
+++ trunk/examples/CatalystAdvent/root/2009/pen/dbic-helpers.pod	2009-12-18 19:28:13 UTC (rev 12430)
@@ -4,7 +4,7 @@
 
 L<DBIx::Class> is one of the most popular ORMs used in Perl and
 Catalyst development; it is remarkably flexible and useful. But there
-is a price for that flexibility. Often things that are concise in
+is a price for that flexibility: often things that are concise in
 other ORMs are complex in L<DBIx::Class>.
 
 L<DBIx::Class::Helpers> aim at solving the complexity problem as
@@ -16,9 +16,10 @@
 =head2 IgnoreWantarray
 
 L<DBIx::Class::Helper::IgnoreWantarray> has the longest name, but the
-most basic functionality: it takes away the context
-sensitivity of C<< $rs->search >>.  Why would a person ever want to do
-that?  I often write code like the following:
+most basic functionality: it takes away the context sensitivity of C<<
+$rs->search >>.  Why would a person ever want to do that? Well, in array
+context, C<< $rs->search >> will return an array of your database. You
+might not want that. I often write code like the following:
 
  return $self->sort(
    $self->paginate(
@@ -29,7 +30,8 @@
 Unfortunately, this often means that instead of passing another
 resultset to C<< $self->sort >>, I end up passing the database
 instead.  This confounds me and my coworkers enough that I'd rather
-call C<< $rs->all >> if I need the actual results.
+call C<< $rs->all >> if I need the actual results. C<IgnoreWantarray>
+makes search always return a resultset.
 
 =head2 JoinTable
 
@@ -73,12 +75,11 @@
 projects. L<DBIx::Class::Helper::SubClass> solves the problem nicely. 
 
 Another reason to use this helper is to define a table without certain
-columns (TEXT columns come to mind.)  Instead of redefining the table
-with the TEXT columns in another place, you might use this helper to
-subclass the one without the TEXT columns and add TEXT columns to the
+columns (TEXT columns come to mind). Instead of redefining the table
+with the text columns in another place, you might use this helper to
+subclass the one without the text columns and add text columns to the
 child class.
 
-
 =head2 VirtualView
 
 L<DBIx::Class::Helper::VirtualView> is the most conceptually complex
@@ -88,7 +89,7 @@
 
 =head2 Extensibility
 
-In writing these components I've tried to make parts override-able in
+In writing these components I've tried to make parts overrideable in
 the spirit of L<DBIx::Class>. For example, if you do not like that
 join tables have an underscore between table names, you could subclass
 L<DBIx::Class::Helper::JoinTable>, override C<set_table>, and then use your




More information about the Catalyst-commits mailing list