examples
Arthur Axel 'fREW' Schmidt [Thu, 10 Jun 2010 23:03:53 +0000 (18:03 -0500)]
slideshow.html

index 42c9fcf..4ea1daf 100644 (file)
@@ -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 {
 
    <div class="slide">
       <h1>search_related</h1>
-      <pre>*get example from work*</pre>
+<pre>my @test_rs = ($schema-&gt;resultset('User')-&gt;search({'me.userid' =&gt; 'marial'})
+   -&gt;related_resultset('access')
+   -&gt;related_resultset('mgmt')
+   -&gt;related_resultset('orders')-&gt;search({'orders.reporttype' =&gt; 0})
+   -&gt;related_resultset('shops')-&gt;search({'shops.status' =&gt; 'Completed', 'shops.datecompleted' =&gt; {-between =&gt; ['2009-10-01','2009-10-08']}})
+   -&gt;related_resultset('rpt_score')-&gt;get_column('raw_scores')-&gt;first);
+</pre>
+   </div>
+
+   <div class="slide">
+      <h1>related_resultset</h1>
+<pre>my @screens = $user-&gt;roles
+   -&gt;related_resultset('role_permissions')
+   -&gt;related_resultset('permission')
+   -&gt;related_resultset('permission_screens')
+   -&gt;related_resultset('screen')
+   -&gt;search(undef, { distinct =&gt; 1 })-&gt;all;</pre>
    </div>
 
    <div class="slide">