From: Damien Krotkine Date: Fri, 22 Apr 2011 16:09:46 +0000 (+0200) Subject: fix documentation regarding resultsets in list context X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=276cff4830fd9552ed28c2d862eb6e8e9fc4e05d;p=dbsrgits%2FDBIx-Class-Historic.git fix documentation regarding resultsets in list context --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 2a5c8a2..7289e8d 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -229,6 +229,9 @@ sub new { my $new_rs = $cd_rs->search([ { year => 2005 }, { year => 2004 } ]); # year = 2005 OR year = 2004 +In list context, C<< ->call() >> is called implicitly on the resultset, thus +returning a list of row objects instead. To avoid that, use L. + If you need to pass in additional attributes but no additional condition, call it as C. @@ -244,6 +247,8 @@ documentation for the first argument, see L. For more help on using joins with search, see L. +See also L. + =cut sub search { @@ -623,7 +628,7 @@ sub _build_unique_query { =item Arguments: $rel, $cond, \%attrs? -=item Return Value: $new_resultset +=item Return Value: $new_resultset (scalar context), @row_objs (list context) =back @@ -634,6 +639,11 @@ sub _build_unique_query { Searches the specified relationship, optionally specifying a condition and attributes for matching records. See L for more information. +In list context, C<< ->call() >> is called implicitly on the resultset, thus +returning a list of row objects instead. To avoid that, use L. + +See also L. + =cut sub search_related { @@ -1342,8 +1352,7 @@ sub count_literal { shift->search_literal(@_)->count; } =back -Returns all elements in the resultset. Called implicitly if the resultset -is returned in list context. +Returns all elements in the resultset. =cut