Skip to content

Commit

Permalink
normalize documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthur Axel 'fREW' Schmidt committed May 3, 2014
1 parent da84fbb commit fb552f6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 23 deletions.
10 changes: 10 additions & 0 deletions lib/DBIx/Class/Helper/ResultSet/Shortcut.pm
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,14 @@ calling C<< $rs->count >>.
# equivalent to...
$foo_rs->search(undef, { prefetch => 'bar' });
=method results_exist
my $results_exist = $schema->resultset('Bar')->search({...})->results_exist;
Uses C<EXISTS> SQL function to check if the query would return anything.
Possibly lighter weight than the much more common C<< foo() if $rs->count >>
idiom.
=head1 SEE ALSO
This component is actually a number of other components put together. It will
Expand Down Expand Up @@ -198,4 +206,6 @@ C<DBIx::Class::Helper::ResultSet::Shortcut::OrderBy>))
(inherits from C<DBIx::Class::Helper::ResultSet::Shortcut::Page> and
L<DBIx::Class::Helper::ResultSet::Shortcut::Rows>)
=item * L<DBIx::Class::Helper::ResultSet::Shortcut::ResultsExist>
=back
23 changes: 0 additions & 23 deletions lib/DBIx/Class/Helper/ResultSet/Shortcut/ResultsExist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package DBIx::Class::Helper::ResultSet::Shortcut::ResultsExist;
use strict;
use warnings;

# ABSTRACT: Determine if a query would return results

sub results_exist {
my $self = shift;

Expand All @@ -16,24 +14,3 @@ sub results_exist {
}

1;

=pod
=head1 SYNOPSIS
my $results_exist = $schema->resultset('Bar')->search({...})->results_exist;
=head1 DESCRIPTION
This component is a shortcut for the case where you'd like to know whether a
query might return data, but you don't actually want the overhead of selecting
and returning columns. Think of the "SELECT 1 FROM Foo IF ..." type of query.
=head1 METHODS
=head2 results_exist
This method takes no arguments and will return 1 if results exists, 0 if they
do not.
=cut

0 comments on commit fb552f6

Please sign in to comment.