Bug 32257: Label for patron attributes misaligned
[koha-ffzg.git] / Koha / Schema / Result / AuthorisedValue.pm
1 use utf8;
2 package Koha::Schema::Result::AuthorisedValue;
3
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
6
7 =head1 NAME
8
9 Koha::Schema::Result::AuthorisedValue
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<authorised_values>
19
20 =cut
21
22 __PACKAGE__->table("authorised_values");
23
24 =head1 ACCESSORS
25
26 =head2 id
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 unique key, used to identify the authorized value
33
34 =head2 category
35
36   data_type: 'varchar'
37   default_value: (empty string)
38   is_foreign_key: 1
39   is_nullable: 0
40   size: 32
41
42 key used to identify the authorized value category
43
44 =head2 authorised_value
45
46   data_type: 'varchar'
47   default_value: (empty string)
48   is_nullable: 0
49   size: 80
50
51 code use to identify the authorized value
52
53 =head2 lib
54
55   data_type: 'varchar'
56   is_nullable: 1
57   size: 200
58
59 authorized value description as printed in the staff interface
60
61 =head2 lib_opac
62
63   data_type: 'varchar'
64   is_nullable: 1
65   size: 200
66
67 authorized value description as printed in the OPAC
68
69 =head2 imageurl
70
71   data_type: 'varchar'
72   is_nullable: 1
73   size: 200
74
75 authorized value URL
76
77 =cut
78
79 __PACKAGE__->add_columns(
80   "id",
81   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
82   "category",
83   {
84     data_type => "varchar",
85     default_value => "",
86     is_foreign_key => 1,
87     is_nullable => 0,
88     size => 32,
89   },
90   "authorised_value",
91   { data_type => "varchar", default_value => "", is_nullable => 0, size => 80 },
92   "lib",
93   { data_type => "varchar", is_nullable => 1, size => 200 },
94   "lib_opac",
95   { data_type => "varchar", is_nullable => 1, size => 200 },
96   "imageurl",
97   { data_type => "varchar", is_nullable => 1, size => 200 },
98 );
99
100 =head1 PRIMARY KEY
101
102 =over 4
103
104 =item * L</id>
105
106 =back
107
108 =cut
109
110 __PACKAGE__->set_primary_key("id");
111
112 =head1 UNIQUE CONSTRAINTS
113
114 =head2 C<av_uniq>
115
116 =over 4
117
118 =item * L</category>
119
120 =item * L</authorised_value>
121
122 =back
123
124 =cut
125
126 __PACKAGE__->add_unique_constraint("av_uniq", ["category", "authorised_value"]);
127
128 =head1 RELATIONS
129
130 =head2 authorised_values_branches
131
132 Type: has_many
133
134 Related object: L<Koha::Schema::Result::AuthorisedValuesBranch>
135
136 =cut
137
138 __PACKAGE__->has_many(
139   "authorised_values_branches",
140   "Koha::Schema::Result::AuthorisedValuesBranch",
141   { "foreign.av_id" => "self.id" },
142   { cascade_copy => 0, cascade_delete => 0 },
143 );
144
145 =head2 category
146
147 Type: belongs_to
148
149 Related object: L<Koha::Schema::Result::AuthorisedValueCategory>
150
151 =cut
152
153 __PACKAGE__->belongs_to(
154   "category",
155   "Koha::Schema::Result::AuthorisedValueCategory",
156   { category_name => "category" },
157   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
158 );
159
160 =head2 illrequests
161
162 Type: has_many
163
164 Related object: L<Koha::Schema::Result::Illrequest>
165
166 =cut
167
168 __PACKAGE__->has_many(
169   "illrequests",
170   "Koha::Schema::Result::Illrequest",
171   { "foreign.status_alias" => "self.authorised_value" },
172   { cascade_copy => 0, cascade_delete => 0 },
173 );
174
175
176 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
177 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:LH9dpEEzlVVsjNVv/jnONg
178
179
180 # You can replace this text with custom code or comments, and it will be preserved on regeneration
181 1;