line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
2319
|
use utf8; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
19
|
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Interchange6::Schema::ResultSet::Navigation; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
Interchange6::Schema::ResultSet::Navigation |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=cut |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 SYNOPSIS |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Provides extra accessor methods for L<Interchange6::Schema::Result::Navigation> |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=cut |
16
|
|
|
|
|
|
|
|
17
|
2
|
|
|
2
|
|
88
|
use strict; |
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
41
|
|
18
|
2
|
|
|
2
|
|
16
|
use warnings; |
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
49
|
|
19
|
2
|
|
|
2
|
|
13
|
use mro 'c3'; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
13
|
|
20
|
|
|
|
|
|
|
|
21
|
2
|
|
|
2
|
|
61
|
use parent 'Interchange6::Schema::ResultSet'; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
10
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 METHODS |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head2 active |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
Returns all rows where L<Interchange6::Schema::Result::Navigation/active> is |
28
|
|
|
|
|
|
|
true. |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=cut |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub active { |
33
|
0
|
|
|
0
|
1
|
|
return $_[0]->search( { $_[0]->me('active') => 1 } ); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head2 with_active_child_count |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Create slot C<active_child_count> in the resultset containing the count of |
39
|
|
|
|
|
|
|
active child navs. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=cut |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub with_active_child_count { |
44
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
return $self->search( |
47
|
|
|
|
|
|
|
undef, |
48
|
|
|
|
|
|
|
{ |
49
|
|
|
|
|
|
|
'+columns' => { |
50
|
|
|
|
|
|
|
active_child_count => |
51
|
|
|
|
|
|
|
$self->correlate('active_children')->count_rs->as_query |
52
|
|
|
|
|
|
|
}, |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head2 with_active_product_count |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Create slot C<active_product_count> in the resultset containing the count of |
60
|
|
|
|
|
|
|
active products associated with each navigation row. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=cut |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub with_active_product_count { |
65
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
66
|
|
|
|
|
|
|
|
67
|
0
|
|
|
|
|
|
return $self->search( |
68
|
|
|
|
|
|
|
undef, |
69
|
|
|
|
|
|
|
{ |
70
|
|
|
|
|
|
|
'+columns' => { |
71
|
|
|
|
|
|
|
active_product_count => |
72
|
|
|
|
|
|
|
$self->correlate('navigation_products') |
73
|
|
|
|
|
|
|
->related_resultset('product')->active->count_rs->as_query |
74
|
|
|
|
|
|
|
}, |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
); |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
1; |