From: Arthur Axel 'fREW' Schmidt Date: Thu, 10 Jun 2010 23:03:53 +0000 (-0500) Subject: examples X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3ab0ef72df802ee2746a733be73a1e4c407f49b5;p=dbsrgits%2Fdbix-class-introduction-presentation.git examples --- diff --git a/slideshow.html b/slideshow.html index 42c9fcf..4ea1daf 100644 --- a/slideshow.html +++ b/slideshow.html @@ -217,7 +217,7 @@ $sth->execute( my $book = $book_rs->search({ title => 'A book title', -}, { rows => 1 })->single; +}, { rows => 1 })->next; my @books = $book_rs->search({ author => $author_id, @@ -485,7 +485,23 @@ sub cheap {

search_related

-
*get example from work*
+
my @test_rs = ($schema->resultset('User')->search({'me.userid' => 'marial'})
+   ->related_resultset('access')
+   ->related_resultset('mgmt')
+   ->related_resultset('orders')->search({'orders.reporttype' => 0})
+   ->related_resultset('shops')->search({'shops.status' => 'Completed', 'shops.datecompleted' => {-between => ['2009-10-01','2009-10-08']}})
+   ->related_resultset('rpt_score')->get_column('raw_scores')->first);
+
+
+ +
+

related_resultset

+
my @screens = $user->roles
+   ->related_resultset('role_permissions')
+   ->related_resultset('permission')
+   ->related_resultset('permission_screens')
+   ->related_resultset('screen')
+   ->search(undef, { distinct => 1 })->all;