| 1 | 2 | ▶ | use utf8; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | |||
| 3 | package Interchange6::Schema::Result::OrderlinesShipping; | ||
| 4 | |||
| 5 | =head1 NAME | ||
| 6 | |||
| 7 | Interchange6::Schema::Result::OrderlinesShipping | ||
| 8 | |||
| 9 | =cut | ||
| 10 | |||
| 11 | 2 | ▶ | use Interchange6::Schema::Candy; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | =head1 ACCESSORS | ||
| 14 | |||
| 15 | =head2 orderlines_id | ||
| 16 | |||
| 17 | Foreign key constraint on L<Interchange6::Schema::Result::Orderline/orderlines_id> | ||
| 18 | via L</orderline> relationship. | ||
| 19 | |||
| 20 | =cut | ||
| 21 | |||
| 22 | 2 | column orderlines_id => { data_type => "integer", is_foreign_key => 1 }; | |
| 23 | |||
| 24 | =head2 addresses_id | ||
| 25 | |||
| 26 | Foreign key constraint on L<Interchange6::Schema::Result::Address/addresses_id> | ||
| 27 | via L</address> relationship. | ||
| 28 | |||
| 29 | =cut | ||
| 30 | |||
| 31 | 2 | column addresses_id => { data_type => "integer", is_foreign_key => 1 }; | |
| 32 | |||
| 33 | =head2 shipments_id | ||
| 34 | |||
| 35 | Foreign key constraint on L<Interchange6::Schema::Result::Shipment/shipments_id> | ||
| 36 | via L</shipment> relationship. | ||
| 37 | |||
| 38 | =cut | ||
| 39 | |||
| 40 | 2 | column shipments_id => { data_type => "integer", is_foreign_key => 1 }; | |
| 41 | |||
| 42 | =head1 PRIMARY KEY | ||
| 43 | |||
| 44 | Each unique combination of L</orderline> and L</address> can have multiple | ||
| 45 | related L</shipments> in case an L</orderline> needs to be shipped in more | ||
| 46 | than one consignment. | ||
| 47 | |||
| 48 | =over 4 | ||
| 49 | |||
| 50 | =item * L</orderlines_id> | ||
| 51 | |||
| 52 | =item * L</addresses_id> | ||
| 53 | |||
| 54 | =back | ||
| 55 | |||
| 56 | =cut | ||
| 57 | |||
| 58 | 2 | primary_key "orderlines_id", "addresses_id"; | |
| 59 | |||
| 60 | =head1 RELATIONS | ||
| 61 | |||
| 62 | =head2 address | ||
| 63 | |||
| 64 | Type: belongs_to | ||
| 65 | |||
| 66 | Related object: L<Interchange6::Schema::Result::Address> | ||
| 67 | |||
| 68 | =cut | ||
| 69 | |||
| 70 | 2 | belongs_to | |
| 71 | address => "Interchange6::Schema::Result::Address", | ||
| 72 | "addresses_id"; | ||
| 73 | |||
| 74 | =head2 orderline | ||
| 75 | |||
| 76 | Type: belongs_to | ||
| 77 | |||
| 78 | Related object: L<Interchange6::Schema::Result::Orderline> | ||
| 79 | |||
| 80 | =cut | ||
| 81 | |||
| 82 | 2 | belongs_to | |
| 83 | orderline => "Interchange6::Schema::Result::Orderline", | ||
| 84 | "orderlines_id"; | ||
| 85 | |||
| 86 | =head2 shipment | ||
| 87 | |||
| 88 | Type: belongs_to | ||
| 89 | |||
| 90 | Related object: L<Interchange6::Schema::Result::Shipment> | ||
| 91 | |||
| 92 | =cut | ||
| 93 | |||
| 94 | 2 | belongs_to | |
| 95 | shipment => "Interchange6::Schema::Result::Shipment", | ||
| 96 | "shipments_id"; | ||
| 97 | |||
| 98 | =head1 METHODS | ||
| 99 | |||
| 100 | =head2 delete | ||
| 101 | |||
| 102 | Rows in this table should not be deleted so we overload | ||
| 103 | L<DBIx::Class::Row/delete> to throw an exception. | ||
| 104 | |||
| 105 | NOTE: if L<DBIx::Class::ResultSet/delete> is called on a result set then this | ||
| 106 | overloaded method is bypassed. Please consider using | ||
| 107 | L<DBIx::Class::ResultSet/delete_all> instead. Of course we also cannot prevent | ||
| 108 | deletes performed outside DBIx::Class control. | ||
| 109 | |||
| 110 | =cut | ||
| 111 | |||
| 112 | sub delete { | ||
| 113 | shift->result_source->schema->throw_exception( | ||
| 114 | 1 | ▶ | "OrderlinesShipping rows cannot be deleted"); |
|
Subroutine
delete: called CC=1 SCAR=0.0
Pod
documented
| |||
| 115 | } | ||
| 116 | |||
| 117 | 2 | 1; | |