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