=head2 new
-=head3 Arguments: ($source, \%$attrs)
+=over 4
+
+=item Arguments: ($source, \%$attrs)
+
+=back
The resultset constructor. Takes a source object (usually a
L<DBIx::Class::ResultSourceProxy::Table>) and an attribute hash (see
=head2 find
-=head3 Arguments: (@colvalues) | (\%cols, \%attrs?)
+=over 4
+
+=item Arguments: (@colvalues) | (\%cols, \%attrs?)
+
+=back
Finds a row based on its primary key or unique constraint. For example:
=head2 slice
-=head3 Arguments: ($first, $last)
+=over 4
+
+=item Arguments: ($first, $last)
+
+=back
Returns a subset of elements from the resultset.
=head2 all
-Returns all elements in the resultset. Called implictly if the resultset
+Returns all elements in the resultset. Called implicitly if the resultset
is returned in list context.
=cut
=head2 update
-=head3 Arguments: (\%values)
+=over 4
+
+=item Arguments: (\%values)
+
+=back
Sets the specified columns in the resultset to the supplied values.
$self->throw_exception("Values for update must be a hash")
unless ref $values eq 'HASH';
return $self->result_source->storage->update(
- $self->result_source->from, $values, $self->{cond});
+ $self->result_source->from, $values, $self->{cond}
+ );
}
=head2 update_all
-=head3 Arguments: (\%values)
+=over 4
+
+=item Arguments: (\%values)
+
+=back
Fetches all objects and updates them one at a time. Note that C<update_all>
will run cascade triggers while L</update> will not.
$del->{$1} = $self->{cond}{$key};
}
}
+
} else {
$self->throw_exception(
- "Can't delete on resultset with condition unless hash or array");
+ "Can't delete on resultset with condition unless hash or array"
+ );
}
$self->result_source->storage->delete($self->result_source->from, $del);
=head2 page
-=head3 Arguments: ($page_num)
+=over 4
+
+=item Arguments: ($page_num)
+
+=back
Returns a new resultset for the specified page.
=head2 new_result
-=head3 Arguments: (\%vals)
+=over 4
+
+=item Arguments: (\%vals)
+
+=back
Creates a result in the resultset's result class.
=head2 create
-=head3 Arguments: (\%vals)
+=over 4
+
+=item Arguments: (\%vals)
+
+=back
Inserts a record into the resultset and returns the object.
=head2 find_or_create
-=head3 Arguments: (\%vals, \%attrs?)
+=over 4
+
+=item Arguments: (\%vals, \%attrs?)
+
+=back
$class->find_or_create({ key => $val, ... });
=head1 ATTRIBUTES
+XXX: FIXME: Attributes docs need clearing up
+
The resultset takes various attributes that modify its behavior. Here's an
overview of them:
=head2 columns
-=head3 Arguments: (arrayref)
+=over 4
+
+=item Arguments: (\@columns)
+
+=back
Shortcut to request a particular set of columns to be retrieved. Adds
C<me.> onto the start of any column without a C<.> in it and sets C<select>
=head2 include_columns
-=head3 Arguments: (arrayref)
+=over 4
+
+=item Arguments: (\@columns)
+
+=back
Shortcut to include additional columns in the returned results - for example
=head2 select
-=head3 Arguments: (arrayref)
+=over 4
+
+=item Arguments: (\@columns)
+
+=back
Indicates which columns should be selected from the storage. You can use
column names, or in the case of RDBMS back ends, function or stored procedure
=head2 as
-=head3 Arguments: (arrayref)
+=over 4
+
+=item Arguments: (\@names)
+
+=back
Indicates column names for object inflation. This is used in conjunction with
C<select>, usually when C<select> contains one or more function or stored
=head2 prefetch
-=head3 Arguments: arrayref/hashref
+=over 4
+
+=item Arguments: (\@relationships)
+
+=back
Contains one or more relationships that should be fetched along with the main
query (when they are accessed afterwards they will have already been
=head2 from
-=head3 Arguments: (arrayref)
+=over 4
+
+=item Arguments: (\@array)
+
+=back
The C<from> attribute gives you manual control over the C<FROM> clause of SQL
statements generated by L<DBIx::Class>, allowing you to express custom C<JOIN>
=head2 page
+=over 4
+
+=item Arguments: ($page)
+
+=back
+
For a paged resultset, specifies which page to retrieve. Leave unset
for an unpaged resultset.
=head2 rows
-For a paged resultset, how many rows per page:
+=over 4
+
+=item Arguments: ($rows)
+
+=back
+
+For a paged resultset, specifies how many rows are in each page:
rows => 10
=head2 group_by
-=head3 Arguments: (arrayref)
+=over 4
+
+=item Arguments: (\@columns)
+
+=back
A arrayref of columns to group by. Can include columns of joined tables.