| 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" }; | ||
| 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; | |