[Bast-commits] r4894 - DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual
castaway at dev.catalyst.perl.org
castaway at dev.catalyst.perl.org
Mon Oct 6 19:16:08 BST 2008
Author: castaway
Date: 2008-10-06 19:16:07 +0100 (Mon, 06 Oct 2008)
New Revision: 4894
Modified:
DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Cookbook.pod
Log:
cosmincx's patch to show relationship attr filtering in cookbook
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Cookbook.pod
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Cookbook.pod 2008-10-06 16:43:06 UTC (rev 4893)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/Cookbook.pod 2008-10-06 18:16:07 UTC (rev 4894)
@@ -905,6 +905,12 @@
__PACKAGE__->has_many('pages' => 'Page', 'book', { order_by => \'page_number DESC'} );
+=head2 Filtering a relationship result set
+
+If you want to get a filtered result set, you can just add add to $attr as follows:
+
+ __PACKAGE__->has_many('pages' => 'Page', 'book', { where => { scrap => 0 } } );
+
=head2 Many-to-many relationships
This is straightforward using L<ManyToMany|DBIx::Class::Relationship/many_to_many>:
More information about the Bast-commits
mailing list