From: Jess Robinson Date: Thu, 27 Jul 2006 07:28:11 +0000 (+0000) Subject: Documentation improvements X-Git-Tag: v0.07002~65 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=eb98561caf4a8342cd6cc477499ef71120765fee;p=dbsrgits%2FDBIx-Class.git Documentation improvements --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index bc6dd2e..1ee7fb6 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -559,7 +559,7 @@ sub _collapse_query { my $max_length = $rs->get_column('length')->max; -Returns a ResultSetColumn instance for $column based on $self +Returns a L instance for a column of the ResultSet. =cut diff --git a/lib/DBIx/Class/ResultSetColumn.pm b/lib/DBIx/Class/ResultSetColumn.pm index 35f8fa4..49b8456 100644 --- a/lib/DBIx/Class/ResultSetColumn.pm +++ b/lib/DBIx/Class/ResultSetColumn.pm @@ -16,7 +16,8 @@ use base 'DBIx::Class'; =head1 DESCRIPTION -A convenience class used to perform operations on a specific column of a resultset. +A convenience class used to perform operations on a specific column of +a resultset. =cut @@ -26,7 +27,8 @@ A convenience class used to perform operations on a specific column of a results my $obj = DBIx::Class::ResultSetColumn->new($rs, $column); -Creates a new resultset column object from the resultset and column passed as params +Creates a new resultset column object from the resultset and column +passed as params. Used internally by L. =cut @@ -52,9 +54,11 @@ sub new { =back -Returns the next value of the column in the resultset (C is there is none). +Returns the next value of the column in the resultset (or C if +there is none). -Much like $rs->next but just returning the one value +Much like L but just returning the +one value. =cut @@ -76,9 +80,11 @@ sub next { =back -Returns all values of the column in the resultset (C is there are none). +Returns all values of the column in the resultset (or C if +there are none). -Much like $rs->all but returns values rather than row objects +Much like L but returns values rather +than row objects. =cut @@ -97,7 +103,10 @@ sub all { =back -Wrapper for ->func. Returns the lowest value of the column in the resultset (C is there are none). + my $first_year = $year_col->min(); + +Wrapper for ->func. Returns the lowest value of the column in the +resultset (or C if there are none). =cut @@ -116,7 +125,10 @@ sub min { =back -Wrapper for ->func. Returns the highest value of the column in the resultset (C is there are none). + my $last_year = $year_col->max(); + +Wrapper for ->func. Returns the highest value of the column in the +resultset (or C if there are none). =cut @@ -135,7 +147,10 @@ sub max { =back -Wrapper for ->func. Returns the sum of all the values in the column of the resultset. Use on varchar-like columns at your own risk. + my $total = $prices_col->sum(); + +Wrapper for ->func. Returns the sum of all the values in the column of +the resultset. Use on varchar-like columns at your own risk. =cut @@ -154,12 +169,13 @@ sub sum { =back -Runs a query using the function on the column and returns the value. For example $rs = $schema->resultset("CD")->search({}); $length = $rs->get_column('title')->func('LENGTH'); -Produces the following SQL - SELECT LENGTH( title ) from cd me +Runs a query using the function on the column and returns the +value. Produces the following SQL: + + SELECT LENGTH( title ) FROM cd me =cut @@ -177,6 +193,8 @@ sub func { Luke Saunders +Jess Robinson + =head1 LICENSE You may distribute this code under the same terms as Perl itself.