| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package DBIx::Class::Helper::ResultSet::Shortcut::ResultsExist; | 
| 2 |  |  |  |  |  |  | $DBIx::Class::Helper::ResultSet::Shortcut::ResultsExist::VERSION = '2.035000'; | 
| 3 | 57 |  |  | 57 |  | 26931 | use strict; | 
|  | 57 |  |  |  |  | 139 |  | 
|  | 57 |  |  |  |  | 1739 |  | 
| 4 | 57 |  |  | 57 |  | 302 | use warnings; | 
|  | 57 |  |  |  |  | 135 |  | 
|  | 57 |  |  |  |  | 1565 |  | 
| 5 |  |  |  |  |  |  |  | 
| 6 | 57 |  |  | 57 |  | 358 | use parent 'DBIx::Class::ResultSet'; | 
|  | 57 |  |  |  |  | 127 |  | 
|  | 57 |  |  |  |  | 300 |  | 
| 7 |  |  |  |  |  |  |  | 
| 8 |  |  |  |  |  |  | sub results_exist_as_query { | 
| 9 | 4 |  |  | 4 | 0 | 102 | my $self = shift; | 
| 10 |  |  |  |  |  |  |  | 
| 11 |  |  |  |  |  |  |  | 
| 12 | 4 |  |  |  |  | 21 | my $reified = $self->search_rs( {}, { | 
| 13 |  |  |  |  |  |  | columns => { _results_existence_check => \ '42' } | 
| 14 |  |  |  |  |  |  | } )->as_query; | 
| 15 |  |  |  |  |  |  |  | 
| 16 |  |  |  |  |  |  |  | 
| 17 | 4 |  |  |  |  | 5767 | $$reified->[0] = "( SELECT EXISTS $$reified->[0] )"; | 
| 18 |  |  |  |  |  |  |  | 
| 19 |  |  |  |  |  |  |  | 
| 20 | 4 |  |  |  |  | 119 | $reified; | 
| 21 |  |  |  |  |  |  | } | 
| 22 |  |  |  |  |  |  |  | 
| 23 |  |  |  |  |  |  |  | 
| 24 |  |  |  |  |  |  | sub results_exist { | 
| 25 | 2 |  |  | 2 | 0 | 84 | my $self = shift; | 
| 26 |  |  |  |  |  |  |  | 
| 27 | 2 |  |  |  |  | 18 | my $query = $self->results_exist_as_query; | 
| 28 | 2 |  |  |  |  | 7 | $$query->[0] .= ' AS _existence_subq'; | 
| 29 |  |  |  |  |  |  |  | 
| 30 | 2 |  |  |  |  | 10 | my( undef, $sth ) = $self->result_source | 
| 31 |  |  |  |  |  |  | ->schema | 
| 32 |  |  |  |  |  |  | ->storage | 
| 33 |  |  |  |  |  |  | ->_select( | 
| 34 |  |  |  |  |  |  | $query, | 
| 35 |  |  |  |  |  |  | \'*', | 
| 36 |  |  |  |  |  |  | {}, | 
| 37 |  |  |  |  |  |  | {}, | 
| 38 |  |  |  |  |  |  | ); | 
| 39 |  |  |  |  |  |  |  | 
| 40 | 2 | 100 |  |  |  | 1972 | $sth->fetchall_arrayref->[0][0] ? 1 : 0; | 
| 41 |  |  |  |  |  |  | } | 
| 42 |  |  |  |  |  |  |  | 
| 43 |  |  |  |  |  |  | 1; | 
| 44 |  |  |  |  |  |  |  | 
| 45 |  |  |  |  |  |  | __END__ | 
| 46 |  |  |  |  |  |  |  | 
| 47 |  |  |  |  |  |  | =pod | 
| 48 |  |  |  |  |  |  |  | 
| 49 |  |  |  |  |  |  | =head1 NAME | 
| 50 |  |  |  |  |  |  |  | 
| 51 |  |  |  |  |  |  | DBIx::Class::Helper::ResultSet::Shortcut::ResultsExist | 
| 52 |  |  |  |  |  |  |  | 
| 53 |  |  |  |  |  |  | =head1 AUTHOR | 
| 54 |  |  |  |  |  |  |  | 
| 55 |  |  |  |  |  |  | Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com> | 
| 56 |  |  |  |  |  |  |  | 
| 57 |  |  |  |  |  |  | =head1 COPYRIGHT AND LICENSE | 
| 58 |  |  |  |  |  |  |  | 
| 59 |  |  |  |  |  |  | This software is copyright (c) 2020 by Arthur Axel "fREW" Schmidt. | 
| 60 |  |  |  |  |  |  |  | 
| 61 |  |  |  |  |  |  | This is free software; you can redistribute it and/or modify it under | 
| 62 |  |  |  |  |  |  | the same terms as the Perl 5 programming language system itself. | 
| 63 |  |  |  |  |  |  |  | 
| 64 |  |  |  |  |  |  | =cut |