Schema/Result/MediaDisplay.pm

filter: Statementstmt 100% 15 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 100% 17 / 17 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Schema/Result/Inventory.pm ↑ Summary Schema/Result/MediaProduct.pm »
1 2 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
2  
3 package Interchange6::Schema::Result::MediaDisplay;
4  
5 =head1 NAME
6  
7 Interchange6::Schema::Result::MediaDisplay
8  
9 =cut
10  
11 2 ▶use Interchange6::Schema::Candy;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 =head1 ACCESSORS
14  
15 =head2 media_displays_id
16  
17 Primary key.
18  
19 =cut
20  
21 2 primary_column media_displays_id => {
22 data_type => "integer",
23 is_auto_increment => 1,
24 sequence => "media_displays_media_displays_id_seq",
25 };
26  
27 =head2 media_types_id
28  
29 FK on L<Interchange6::Schema::Result::MediaType/media_types_id>.
30  
31 =cut
32  
33 2 column media_types_id =>
34 { data_type => "integer", is_foreign_key => 1 };
35  
36 =head2 type
37  
38 Display type.
39  
40 Examples: C<image_cart>, C<image_detail>, C<image_thumb>, C<video_full>.
41  
42 =cut
43  
44 2 column type => { data_type => "varchar", size => 255 };
45  
46 =head2 name
47  
48 Name. Is nullable.
49  
50 =cut
51  
52 2 column name => { data_type => "varchar", is_nullable => 1, size => 255 };
53  
54 =head2 path
55  
56 Each display should have his own path, and it's listed here: E.g.
57 /images/thumbs/ or /video/full/
58  
59 It's used by the Product class to create the uri for each display.
60  
61 Is nullable.
62  
63 =cut
64  
65 2 column path => { data_type => "varchar", is_nullable => 1, size => 255 };
66  
67 =head2 size
68  
69 Size. Is nullable.
70  
71 =cut
72  
73 2 column size => { data_type => "varchar", is_nullable => 1, size => 255 };
74  
75 =head1 UNIQUE CONSTRAINTS
76  
77 =head2 C<media_types_id_type_unique>
78  
79 =over 4
80  
81 =item * L</media_types_id>
82  
83 =item * L</type>
84  
85 =back
86  
87 =cut
88  
89 2 unique_constraint media_types_id_type_unique => [ "media_types_id", "type" ];
90  
91 =head1 RELATIONS
92  
93 =head2 media_type
94  
95 Type: belongs_to
96  
97 Related object: L<Interchange6::Schema::Result::MediaType>
98  
99 =cut
100  
101 2 belongs_to
102 media_type => "Interchange6::Schema::Result::MediaType",
103 "media_types_id",
104 { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" };
105  
106 2 1;
« Schema/Result/Inventory.pm ↑ Summary Schema/Result/MediaProduct.pm »