| 1 | 2 | ▶ | use utf8; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | |||
| 3 | package Interchange6::Schema::Result::MediaType; | ||
| 4 | |||
| 5 | =head1 NAME | ||
| 6 | |||
| 7 | Interchange6::Schema::Result::MediaType | ||
| 8 | |||
| 9 | =head1 SYNOPSIS | ||
| 10 | |||
| 11 | This table holds the available media types to use in | ||
| 12 | L<Interchange6::Schema::Result::MediaDisplay>. | ||
| 13 | |||
| 14 | This table should hold only the "parent" type of a media, like | ||
| 15 | C<image> or C<video>. | ||
| 16 | |||
| 17 | =cut | ||
| 18 | |||
| 19 | 2 | ▶ | use Interchange6::Schema::Candy; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 20 | |||
| 21 | =head1 ACCESSORS | ||
| 22 | |||
| 23 | =head2 media_types_id | ||
| 24 | |||
| 25 | Primary key. | ||
| 26 | |||
| 27 | =cut | ||
| 28 | |||
| 29 | 2 | primary_column media_types_id => { | |
| 30 | data_type => "integer", | ||
| 31 | is_auto_increment => 1, | ||
| 32 | sequence => "media_types_media_types_id_seq", | ||
| 33 | }; | ||
| 34 | |||
| 35 | =head2 type | ||
| 36 | |||
| 37 | Type of media, e.g.: image, video. | ||
| 38 | |||
| 39 | Unique constraint. | ||
| 40 | |||
| 41 | =cut | ||
| 42 | |||
| 43 | 2 | unique_column type => { data_type => "varchar", size => 32 }; | |
| 44 | |||
| 45 | =head1 RELATIONS | ||
| 46 | |||
| 47 | =head2 media_displays | ||
| 48 | |||
| 49 | Type: has_many | ||
| 50 | |||
| 51 | Related object: L<Interchange6::Schema::Result::MediaDisplay> | ||
| 52 | |||
| 53 | =cut | ||
| 54 | |||
| 55 | 2 | has_many | |
| 56 | media_displays => "Interchange6::Schema::Result::MediaDisplay", | ||
| 57 | "media_types_id", | ||
| 58 | { cascade_copy => 0, cascade_delete => 0 }; | ||
| 59 | |||
| 60 | =head2 media | ||
| 61 | |||
| 62 | Type: has_many | ||
| 63 | |||
| 64 | Related object: L<Interchange6::Schema::Result::Media> | ||
| 65 | |||
| 66 | =cut | ||
| 67 | |||
| 68 | 2 | has_many | |
| 69 | media => "Interchange6::Schema::Result::Media", | ||
| 70 | "media_types_id", | ||
| 71 | { cascade_copy => 0, cascade_delete => 0 }; | ||
| 72 | |||
| 73 | 2 | 1; | |