File Coverage

blib/lib/Test/DBIx/Class/Example/Schema/Result/GermanPhone.pm
Criterion Covered Total %
statement 3 3 100.0
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 4 4 100.0


line stmt bran cond sub pod time code
1             package Test::DBIx::Class::Example::Schema::Result::GermanPhone; {
2 15     15   29107 use base 'Test::DBIx::Class::Example::Schema::Result';
  15         22  
  15         3097  
3              
4             __PACKAGE__->table_class('DBIx::Class::ResultSource::View');
5             __PACKAGE__->table('german_phone');
6              
7             __PACKAGE__->result_source_instance->is_virtual(1);
8             __PACKAGE__->result_source_instance->view_definition(
9             q{SELECT * FROM phone WHERE number LIKE '+49%'}
10             );
11             __PACKAGE__->result_source_instance->deploy_depends_on(
12             ['Test::DBIx::Class::Example::Schema::Result::Phone']
13             );
14              
15             __PACKAGE__->add_columns(
16             fk_person_id => {
17             data_type => 'varchar',
18             size => '36',
19             is_nullable => 0,
20             },
21             number => {
22             data_type => 'varchar',
23             size => '10',
24             is_nullable => 0,
25             },
26             );
27              
28             __PACKAGE__->set_primary_key('fk_person_id','number');
29              
30             __PACKAGE__->belongs_to(
31             owner => 'Test::DBIx::Class::Example::Schema::Result::Person',
32             { 'foreign.person_id' => 'self.fk_person_id' },
33             );
34              
35             } 1
36              
37             __END__
38              
39             =head1 NAME
40              
41             Test::DBIx::Class::Example::Schema::Result::GermanPhone - Example of virtual view
42              
43             =head1 SYNOPSIS
44              
45             TBD
46              
47             =head1 DESCRIPTION
48              
49             Sample result class for testing and for other component authors
50              
51             =head1 SEE ALSO
52              
53             The following modules or resources may be of interest.
54              
55             L<DBIx::Class>
56              
57             =head1 AUTHOR
58              
59             Vadim Pushtaev C<< <pushtaev@cpan.org> >>
60              
61             =head1 COPYRIGHT & LICENSE
62              
63             Copyright 2016, Vadim Pushtaev C<< <pushtaev@cpan.org> >>
64              
65             This program is free software; you can redistribute it and/or modify
66             it under the same terms as Perl itself.
67              
68             =cut