« Preferences/Schema/Result/PrfDefaultValues.pm
↑ Summary
Preferences/Schema/Result/PrfPreference.pm »
| 1 | |||
| 2 | package OpusVL::Preferences::Schema::Result::PrfOwnerType; | ||
| 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 | |||
| 7 | 1 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 1 | ▶ | use MooseX::NonMoose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 1 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 1 | extends 'DBIx::Class::Core'; | |
| 12 | |||
| 13 | 1 | __PACKAGE__->table ("prf_owner_type"); | |
| 14 | |||
| 15 | 1 | __PACKAGE__->add_columns | |
| 16 | ( | ||
| 17 | prf_owner_type_id => | ||
| 18 | { | ||
| 19 | data_type => 'integer', | ||
| 20 | is_nullable => 0, | ||
| 21 | is_auto_increment => 1, | ||
| 22 | }, | ||
| 23 | |||
| 24 | owner_table => | ||
| 25 | { | ||
| 26 | data_type => 'varchar', | ||
| 27 | is_nullable => 0, | ||
| 28 | }, | ||
| 29 | |||
| 30 | owner_resultset => | ||
| 31 | { | ||
| 32 | data_type => 'varchar', | ||
| 33 | is_nullable => 0 | ||
| 34 | } | ||
| 35 | ); | ||
| 36 | |||
| 37 | 1 | __PACKAGE__->set_primary_key ('prf_owner_type_id'); | |
| 38 | |||
| 39 | 1 | __PACKAGE__->add_unique_constraints | |
| 40 | ( | ||
| 41 | prf_owner_type__table => ['owner_table'], | ||
| 42 | prf_owner_type__resultset => ['owner_resultset'], | ||
| 43 | ); | ||
| 44 | |||
| 45 | 1 | __PACKAGE__->has_many | |
| 46 | ( | ||
| 47 | prf_owners => 'OpusVL::Preferences::Schema::Result::PrfOwner', | ||
| 48 | { | ||
| 49 | 'foreign.prf_owner_type_id' => 'self.prf_owner_type_id' | ||
| 50 | }, | ||
| 51 | ); | ||
| 52 | |||
| 53 | 1 | __PACKAGE__->has_many | |
| 54 | ( | ||
| 55 | prf_defaults => 'OpusVL::Preferences::Schema::Result::PrfDefault', | ||
| 56 | { | ||
| 57 | 'foreign.prf_owner_type_id' => 'self.prf_owner_type_id' | ||
| 58 | }, | ||
| 59 | ); | ||
| 60 | |||
| 61 | 1 | return 1; | |
| 62 | |||
| 63 | |||
| 64 | =head1 DESCRIPTION | ||
| 65 | |||
| 66 | This table for some reason stores an association between a table name, a | ||
| 67 | resultset name, and a sequential ID. These correspond to the classes in the host | ||
| 68 | database that are C<PrfOwner>s. | ||
| 69 | |||
| 70 | This appears to be entirely so that we can use numbers instead of letters | ||
| 71 | everywhere else. | ||
| 72 | |||
| 73 | |||
| 74 | =head1 METHODS | ||
| 75 | |||
| 76 | =head1 ATTRIBUTES | ||
| 77 | |||
| 78 | =head2 prf_owners | ||
| 79 | |||
| 80 | =head2 prf_defaults | ||
| 81 | |||
| 82 | =head2 prf_owner_type_id | ||
| 83 | |||
| 84 | =head2 owner_table | ||
| 85 | |||
| 86 | =head2 owner_resultset | ||
| 87 | |||
| 88 | |||
| 89 | =head1 LICENSE AND COPYRIGHT | ||
| 90 | |||
| 91 | Copyright 2012 OpusVL. | ||
| 92 | |||
| 93 | This software is licensed according to the "IP Assignment Schedule" provided with the development project. | ||
| 94 | |||
| 95 | =cut | ||