| 1 | 2 | ▶ | use utf8; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | |||
| 3 | package Interchange6::Schema::Result::Shipment; | ||
| 4 | |||
| 5 | =head1 NAME | ||
| 6 | |||
| 7 | Interchange6::Schema::Result::Shipment | ||
| 8 | |||
| 9 | =cut | ||
| 10 | |||
| 11 | 2 | use Interchange6::Schema::Candy -components => | |
| 12 | 2 | ▶ | [qw(InflateColumn::DateTime TimeStamp)]; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | |||
| 14 | =head1 ACCESSORS | ||
| 15 | |||
| 16 | =head2 shipments_id | ||
| 17 | |||
| 18 | Primary key. | ||
| 19 | |||
| 20 | =cut | ||
| 21 | |||
| 22 | 2 | primary_column shipments_id => | |
| 23 | { data_type => "integer", is_auto_increment => 1 }; | ||
| 24 | |||
| 25 | =head2 tracking_number | ||
| 26 | |||
| 27 | Tracking number. Defaults to empty string. | ||
| 28 | |||
| 29 | =cut | ||
| 30 | |||
| 31 | 2 | column tracking_number => { | |
| 32 | data_type => "varchar", | ||
| 33 | default_value => "", | ||
| 34 | size => 255 | ||
| 35 | }; | ||
| 36 | |||
| 37 | =head2 shipment_carriers_id | ||
| 38 | |||
| 39 | FK on L<Interchange6::Schema::Result::ShipmentCarrier/shipment_carriers_id>. | ||
| 40 | |||
| 41 | =cut | ||
| 42 | |||
| 43 | 2 | column shipment_carriers_id => | |
| 44 | { data_type => "integer" }; | ||
| 45 | |||
| 46 | =head2 shipment_methods_id | ||
| 47 | |||
| 48 | FK on L<Interchange6::Schema::Result::ShipmentMethod/shipment_methods_id>. | ||
| 49 | |||
| 50 | =cut | ||
| 51 | |||
| 52 | 2 | column shipment_methods_id => | |
| 53 | { data_type => "integer" }; | ||
| 54 | |||
| 55 | =head2 created | ||
| 56 | |||
| 57 | Date and time when this record was created returned as L<DateTime> object. | ||
| 58 | Value is auto-set on insert. | ||
| 59 | |||
| 60 | =cut | ||
| 61 | |||
| 62 | 2 | column created => | |
| 63 | { data_type => "datetime", set_on_create => 1 }; | ||
| 64 | |||
| 65 | =head2 last_modified | ||
| 66 | |||
| 67 | Date and time when this record was last modified returned as L<DateTime> object. | ||
| 68 | Value is auto-set on insert and update. | ||
| 69 | |||
| 70 | =cut | ||
| 71 | |||
| 72 | 2 | column last_modified => { | |
| 73 | data_type => "datetime", | ||
| 74 | set_on_create => 1, | ||
| 75 | set_on_update => 1, | ||
| 76 | }; | ||
| 77 | |||
| 78 | =head1 RELATIONS | ||
| 79 | |||
| 80 | =head2 shipment_carrier | ||
| 81 | |||
| 82 | Type: belongs_to | ||
| 83 | |||
| 84 | Related object: L<Interchange6::Schema::Result::ShipmentCarrier> | ||
| 85 | |||
| 86 | =cut | ||
| 87 | |||
| 88 | 2 | belongs_to | |
| 89 | shipment_carrier => "Interchange6::Schema::Result::ShipmentCarrier", | ||
| 90 | "shipment_carriers_id", | ||
| 91 | { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }; | ||
| 92 | |||
| 93 | =head2 shipment_method | ||
| 94 | |||
| 95 | Type: belongs_to | ||
| 96 | |||
| 97 | Related object: L<Interchange6::Schema::Result::ShipmentMethod> | ||
| 98 | |||
| 99 | =cut | ||
| 100 | |||
| 101 | 2 | belongs_to | |
| 102 | shipment_method => "Interchange6::Schema::Result::ShipmentMethod", | ||
| 103 | "shipment_methods_id", | ||
| 104 | { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }; | ||
| 105 | |||
| 106 | 2 | 1; | |