| 1 | |||
| 2 | package OpusVL::Preferences::Schema::Result::PrfPreference; | ||
| 3 | |||
| 4 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 1 | ▶ | use MooseX::NonMoose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 1 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 1 | extends 'DBIx::Class::Core'; | |
| 11 | |||
| 12 | 1 | __PACKAGE__->table("prf_preferences"); | |
| 13 | |||
| 14 | 1 | __PACKAGE__->add_columns | |
| 15 | ( | ||
| 16 | prf_preference_id => | ||
| 17 | { | ||
| 18 | data_type => "integer", | ||
| 19 | is_nullable => 0, | ||
| 20 | is_auto_increment => 1 | ||
| 21 | }, | ||
| 22 | |||
| 23 | prf_owner_id => | ||
| 24 | { | ||
| 25 | data_type => 'integer', | ||
| 26 | is_nullable => 0 | ||
| 27 | }, | ||
| 28 | |||
| 29 | prf_owner_type_id => | ||
| 30 | { | ||
| 31 | data_type => "integer", | ||
| 32 | is_nullable => 0, | ||
| 33 | }, | ||
| 34 | |||
| 35 | name => | ||
| 36 | { | ||
| 37 | data_type => 'varchar', | ||
| 38 | is_nullable => 0 | ||
| 39 | }, | ||
| 40 | |||
| 41 | value => | ||
| 42 | { | ||
| 43 | data_type => 'varchar', | ||
| 44 | is_nullable => 1 | ||
| 45 | }, | ||
| 46 | ); | ||
| 47 | |||
| 48 | 1 | __PACKAGE__->set_primary_key("prf_preference_id"); | |
| 49 | |||
| 50 | 1 | __PACKAGE__->add_unique_constraint([ qw/prf_preference_id prf_owner_type_id name/ ]); | |
| 51 | |||
| 52 | 1 | __PACKAGE__->belongs_to | |
| 53 | ( | ||
| 54 | prf_owner => 'OpusVL::Preferences::Schema::Result::PrfOwner', | ||
| 55 | { | ||
| 56 | 'foreign.prf_owner_id' => 'self.prf_owner_id', | ||
| 57 | 'foreign.prf_owner_type_id' => 'self.prf_owner_type_id' | ||
| 58 | } | ||
| 59 | ); | ||
| 60 | |||
| 61 | 1 | __PACKAGE__->might_have(unique_value => | |
| 62 | "OpusVL::Preferences::Schema::Result::CustomDataUniqueValues", | ||
| 63 | { | ||
| 64 | "foreign.prf_owner_type_id" => "self.prf_owner_type_id", | ||
| 65 | "foreign.name" => "self.name", | ||
| 66 | "foreign.value_id" => "self.prf_preference_id" | ||
| 67 | }, | ||
| 68 | { is_foreign_key_constraint => 0, cascade_delete => 1 }); | ||
| 69 | |||
| 70 | |||
| 71 | 1 | return 1; | |
| 72 | |||
| 73 | __END__ | ||
| 74 | |||
| 75 | =pod | ||
| 76 | |||
| 77 | =encoding UTF-8 | ||
| 78 | |||
| 79 | =head1 NAME | ||
| 80 | |||
| 81 | OpusVL::Preferences::Schema::Result::PrfPreference | ||
| 82 | |||
| 83 | =head1 VERSION | ||
| 84 | |||
| 85 | version 0.24 | ||
| 86 | |||
| 87 | =head1 DESCRIPTION | ||
| 88 | |||
| 89 | =head1 METHODS | ||
| 90 | |||
| 91 | =head1 ATTRIBUTES | ||
| 92 | |||
| 93 | =head2 prf_owner | ||
| 94 | |||
| 95 | =head2 prf_preference_id | ||
| 96 | |||
| 97 | =head2 prf_owner_id | ||
| 98 | |||
| 99 | =head2 prf_owner_type_id | ||
| 100 | |||
| 101 | =head2 name | ||
| 102 | |||
| 103 | =head2 value | ||
| 104 | |||
| 105 | =head1 LICENSE AND COPYRIGHT | ||
| 106 | |||
| 107 | Copyright 2012 OpusVL. | ||
| 108 | |||
| 109 | This software is licensed according to the "IP Assignment Schedule" provided with the development project. | ||
| 110 | |||
| 111 | =head1 AUTHOR | ||
| 112 | |||
| 113 | OpusVL - www.opusvl.com | ||
| 114 | |||
| 115 | =head1 COPYRIGHT AND LICENSE | ||
| 116 | |||
| 117 | This software is copyright (c) 2011 by OpusVL - www.opusvl.com. | ||
| 118 | |||
| 119 | This is free software; you can redistribute it and/or modify it under | ||
| 120 | the same terms as the Perl 5 programming language system itself. | ||
| 121 | |||
| 122 | =cut | ||