Bug 17855 - Followup patch following requests in comments 176 and 177
[koha.git] / Koha / Schema / Result / SearchField.pm
blobee32f42cf2be2466cc7b3592fea1b7fe7e839e4e
1 use utf8;
2 package Koha::Schema::Result::SearchField;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
7 =head1 NAME
9 Koha::Schema::Result::SearchField
11 =cut
13 use strict;
14 use warnings;
16 use base 'DBIx::Class::Core';
18 =head1 TABLE: C<search_field>
20 =cut
22 __PACKAGE__->table("search_field");
24 =head1 ACCESSORS
26 =head2 id
28 data_type: 'integer'
29 is_auto_increment: 1
30 is_nullable: 0
32 =head2 name
34 data_type: 'varchar'
35 is_nullable: 0
36 size: 255
38 the name of the field as it will be stored in the search engine
40 =head2 label
42 data_type: 'varchar'
43 is_nullable: 0
44 size: 255
46 the human readable name of the field, for display
48 =head2 type
50 data_type: 'enum'
51 extra: {list => ["","string","date","number","boolean","sum"]}
52 is_nullable: 0
54 what type of data this holds, relevant when storing it in the search engine
56 =cut
58 __PACKAGE__->add_columns(
59 "id",
60 { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
61 "name",
62 { data_type => "varchar", is_nullable => 0, size => 255 },
63 "label",
64 { data_type => "varchar", is_nullable => 0, size => 255 },
65 "type",
67 data_type => "enum",
68 extra => { list => ["", "string", "date", "number", "boolean", "sum"] },
69 is_nullable => 0,
73 =head1 PRIMARY KEY
75 =over 4
77 =item * L</id>
79 =back
81 =cut
83 __PACKAGE__->set_primary_key("id");
85 =head1 UNIQUE CONSTRAINTS
87 =head2 C<name>
89 =over 4
91 =item * L</name>
93 =back
95 =cut
97 __PACKAGE__->add_unique_constraint("name", ["name"]);
99 =head1 RELATIONS
101 =head2 search_marc_to_fields
103 Type: has_many
105 Related object: L<Koha::Schema::Result::SearchMarcToField>
107 =cut
109 __PACKAGE__->has_many(
110 "search_marc_to_fields",
111 "Koha::Schema::Result::SearchMarcToField",
112 { "foreign.search_field_id" => "self.id" },
113 { cascade_copy => 0, cascade_delete => 0 },
117 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-03-23 13:30:43
118 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1IenQWmCO16tJ/nIFTFYug
120 __PACKAGE__->many_to_many("search_marc_maps", "search_marc_to_fields", "search_marc_map");