|
Line 0
Link Here
|
|
|
1 |
use utf8; |
| 2 |
package Koha::Schema::Result::Display; |
| 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::Display |
| 10 |
|
| 11 |
=cut |
| 12 |
|
| 13 |
use strict; |
| 14 |
use warnings; |
| 15 |
|
| 16 |
use base 'DBIx::Class::Core'; |
| 17 |
|
| 18 |
=head1 TABLE: C<displays> |
| 19 |
|
| 20 |
=cut |
| 21 |
|
| 22 |
__PACKAGE__->table("displays"); |
| 23 |
|
| 24 |
=head1 ACCESSORS |
| 25 |
|
| 26 |
=head2 display_id |
| 27 |
|
| 28 |
data_type: 'integer' |
| 29 |
is_auto_increment: 1 |
| 30 |
is_nullable: 0 |
| 31 |
|
| 32 |
unique id for the display |
| 33 |
|
| 34 |
=head2 display_name |
| 35 |
|
| 36 |
data_type: 'varchar' |
| 37 |
is_nullable: 1 |
| 38 |
size: 255 |
| 39 |
|
| 40 |
the name of the display |
| 41 |
|
| 42 |
=head2 start_date |
| 43 |
|
| 44 |
data_type: 'date' |
| 45 |
datetime_undef_if_invalid: 1 |
| 46 |
is_nullable: 1 |
| 47 |
|
| 48 |
the start date of the display (optional) |
| 49 |
|
| 50 |
=head2 end_date |
| 51 |
|
| 52 |
data_type: 'date' |
| 53 |
datetime_undef_if_invalid: 1 |
| 54 |
is_nullable: 1 |
| 55 |
|
| 56 |
the end date of the display (optional) |
| 57 |
|
| 58 |
=head2 enabled |
| 59 |
|
| 60 |
data_type: 'tinyint' |
| 61 |
default_value: 1 |
| 62 |
is_nullable: 0 |
| 63 |
|
| 64 |
determines whether the display is active |
| 65 |
|
| 66 |
=head2 display_location |
| 67 |
|
| 68 |
data_type: 'varchar' |
| 69 |
is_nullable: 1 |
| 70 |
size: 80 |
| 71 |
|
| 72 |
the shelving location for the display (optional) |
| 73 |
|
| 74 |
=head2 display_code |
| 75 |
|
| 76 |
data_type: 'varchar' |
| 77 |
is_nullable: 1 |
| 78 |
size: 80 |
| 79 |
|
| 80 |
the collection code for the display (optional) |
| 81 |
|
| 82 |
=head2 display_branch |
| 83 |
|
| 84 |
data_type: 'varchar' |
| 85 |
is_foreign_key: 1 |
| 86 |
is_nullable: 1 |
| 87 |
size: 10 |
| 88 |
|
| 89 |
a new home branch for the item to have while on display (optional) |
| 90 |
|
| 91 |
=head2 display_holding_branch |
| 92 |
|
| 93 |
data_type: 'varchar' |
| 94 |
is_foreign_key: 1 |
| 95 |
is_nullable: 1 |
| 96 |
size: 10 |
| 97 |
|
| 98 |
a new holding branch for the item to have while on display (optional) |
| 99 |
|
| 100 |
=head2 display_itype |
| 101 |
|
| 102 |
data_type: 'varchar' |
| 103 |
is_foreign_key: 1 |
| 104 |
is_nullable: 1 |
| 105 |
size: 10 |
| 106 |
|
| 107 |
a new itype for the item to have while on display (optional) |
| 108 |
|
| 109 |
=head2 staff_note |
| 110 |
|
| 111 |
data_type: 'mediumtext' |
| 112 |
is_nullable: 1 |
| 113 |
|
| 114 |
staff note for the display |
| 115 |
|
| 116 |
=head2 public_note |
| 117 |
|
| 118 |
data_type: 'mediumtext' |
| 119 |
is_nullable: 1 |
| 120 |
|
| 121 |
public note for the display |
| 122 |
|
| 123 |
=head2 display_days |
| 124 |
|
| 125 |
data_type: 'integer' |
| 126 |
is_nullable: 1 |
| 127 |
|
| 128 |
default number of days items will remain on display |
| 129 |
|
| 130 |
=head2 display_return_over |
| 131 |
|
| 132 |
data_type: 'enum' |
| 133 |
default_value: 'no' |
| 134 |
extra: {list => ["yes - any library","yes - except at home library","no"]} |
| 135 |
is_nullable: 0 |
| 136 |
|
| 137 |
should the item be removed from the display when it is returned |
| 138 |
|
| 139 |
=cut |
| 140 |
|
| 141 |
__PACKAGE__->add_columns( |
| 142 |
"display_id", |
| 143 |
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, |
| 144 |
"display_name", |
| 145 |
{ data_type => "varchar", is_nullable => 1, size => 255 }, |
| 146 |
"start_date", |
| 147 |
{ data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, |
| 148 |
"end_date", |
| 149 |
{ data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, |
| 150 |
"enabled", |
| 151 |
{ data_type => "tinyint", default_value => 1, is_nullable => 0 }, |
| 152 |
"display_location", |
| 153 |
{ data_type => "varchar", is_nullable => 1, size => 80 }, |
| 154 |
"display_code", |
| 155 |
{ data_type => "varchar", is_nullable => 1, size => 80 }, |
| 156 |
"display_branch", |
| 157 |
{ data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, |
| 158 |
"display_holding_branch", |
| 159 |
{ data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, |
| 160 |
"display_itype", |
| 161 |
{ data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, |
| 162 |
"staff_note", |
| 163 |
{ data_type => "mediumtext", is_nullable => 1 }, |
| 164 |
"public_note", |
| 165 |
{ data_type => "mediumtext", is_nullable => 1 }, |
| 166 |
"display_days", |
| 167 |
{ data_type => "integer", is_nullable => 1 }, |
| 168 |
"display_return_over", |
| 169 |
{ |
| 170 |
data_type => "enum", |
| 171 |
default_value => "no", |
| 172 |
extra => { |
| 173 |
list => ["yes - any library", "yes - except at home library", "no"], |
| 174 |
}, |
| 175 |
is_nullable => 0, |
| 176 |
}, |
| 177 |
); |
| 178 |
|
| 179 |
=head1 PRIMARY KEY |
| 180 |
|
| 181 |
=over 4 |
| 182 |
|
| 183 |
=item * L</display_id> |
| 184 |
|
| 185 |
=back |
| 186 |
|
| 187 |
=cut |
| 188 |
|
| 189 |
__PACKAGE__->set_primary_key("display_id"); |
| 190 |
|
| 191 |
=head1 RELATIONS |
| 192 |
|
| 193 |
=head2 display_branch |
| 194 |
|
| 195 |
Type: belongs_to |
| 196 |
|
| 197 |
Related object: L<Koha::Schema::Result::Branch> |
| 198 |
|
| 199 |
=cut |
| 200 |
|
| 201 |
__PACKAGE__->belongs_to( |
| 202 |
"display_branch", |
| 203 |
"Koha::Schema::Result::Branch", |
| 204 |
{ branchcode => "display_branch" }, |
| 205 |
{ |
| 206 |
is_deferrable => 1, |
| 207 |
join_type => "LEFT", |
| 208 |
on_delete => "CASCADE", |
| 209 |
on_update => "CASCADE", |
| 210 |
}, |
| 211 |
); |
| 212 |
|
| 213 |
=head2 display_holding_branch |
| 214 |
|
| 215 |
Type: belongs_to |
| 216 |
|
| 217 |
Related object: L<Koha::Schema::Result::Branch> |
| 218 |
|
| 219 |
=cut |
| 220 |
|
| 221 |
__PACKAGE__->belongs_to( |
| 222 |
"display_holding_branch", |
| 223 |
"Koha::Schema::Result::Branch", |
| 224 |
{ branchcode => "display_holding_branch" }, |
| 225 |
{ |
| 226 |
is_deferrable => 1, |
| 227 |
join_type => "LEFT", |
| 228 |
on_delete => "CASCADE", |
| 229 |
on_update => "CASCADE", |
| 230 |
}, |
| 231 |
); |
| 232 |
|
| 233 |
=head2 display_items |
| 234 |
|
| 235 |
Type: has_many |
| 236 |
|
| 237 |
Related object: L<Koha::Schema::Result::DisplayItem> |
| 238 |
|
| 239 |
=cut |
| 240 |
|
| 241 |
__PACKAGE__->has_many( |
| 242 |
"display_items", |
| 243 |
"Koha::Schema::Result::DisplayItem", |
| 244 |
{ "foreign.display_id" => "self.display_id" }, |
| 245 |
{ cascade_copy => 0, cascade_delete => 0 }, |
| 246 |
); |
| 247 |
|
| 248 |
=head2 display_itype |
| 249 |
|
| 250 |
Type: belongs_to |
| 251 |
|
| 252 |
Related object: L<Koha::Schema::Result::Itemtype> |
| 253 |
|
| 254 |
=cut |
| 255 |
|
| 256 |
__PACKAGE__->belongs_to( |
| 257 |
"display_itype", |
| 258 |
"Koha::Schema::Result::Itemtype", |
| 259 |
{ itemtype => "display_itype" }, |
| 260 |
{ |
| 261 |
is_deferrable => 1, |
| 262 |
join_type => "LEFT", |
| 263 |
on_delete => "CASCADE", |
| 264 |
on_update => "CASCADE", |
| 265 |
}, |
| 266 |
); |
| 267 |
|
| 268 |
|
| 269 |
# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-10-29 13:35:51 |
| 270 |
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mzpC+5bt7kie1FjMxakfoQ |
| 271 |
|
| 272 |
|
| 273 |
# You can replace this text with custom code or comments, and it will be preserved on regeneration |
| 274 |
1; |