GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Interchange6::Schema::Result::Zone(3) User Contributed Perl Documentation Interchange6::Schema::Result::Zone(3)

Interchange6::Schema::Result::Zone

In the context of zones the term 'state' refers to state, province or other principal subdivision of a country as defined in ISO 3116-2 <http://en.wikipedia.org/wiki/ISO_3166-2>. Countries to be added to a zone must already exist in Interchange6::Schema::Result::Country and states in Interchange6::Schema::Result::State.

Zones can contain any of the following:

  • No countries and no states

    An empty zone must be created before countries/states are added but otherwise is probably not useful.

  • Multiple countries

    For example to create a trading group like the European Union.

  • A single country
  • A single country with a single state

    For example Quebec in Canada which has GST + QST

  • A single country with multiple states

    For example a group containing all Canadian provinces that charge only GST.

The following combinations are NOT allowed:

  • Multiple countries with one or more states
  • One or more states with no country

Countries and states should be added to and removed from the zone using these methods which are described further below:

  • add_countries
  • remove_countries
  • add_states
  • remove_states

NOTE: avoid using other methods from DBIx::Class::Relationship::Base since you may inadvertently end up with an invalid zone.

Primary Key.

For example for storing the UPS/USPS zone code or a simple name for the zone.

Unique constraint.

Date and time when this record was created returned as DateTime object. Value is auto-set on insert.

Date and time when this record was last modified returned as DateTime object. Value is auto-set on insert and update.

Type: has_many

Related object: Interchange6::Schema::Result::ZoneCountry

Type: many_to_many

Accessor to related country results ordered by name.

Type: has_many

Related object: Interchange6::Schema::Result::ZoneState

Type: many_to_many

Accessor to related state results ordered by name.

"has_many" relationship with Interchange6::Schema::Result::ShipmentDestination

"many_to_many" relationship to shipment_method. Currently it ignores the "active" field in shipment_destinations.

Overloaded method. We allow a form of multi-create here so you can do something like:

    $schema->resultset('Zone')->create({
        zone      => 'some states of the USA',
        countries => [ 'US' ],
        states    => [ 'CA', 'PA' ],
    });

If there is only a single country or state the value can be a scalar instead of a hashref.

Argument is one of:
an Interchange6::Schema::Result::Country object
a country ISO code
an arrayref of the above (can include a mixture of both)

Returns the zone object on success.

Argument can be Interchange6::Schema::Result::Country, country name or iso code. Returns 1 if zone includes that country else 0;

Takes no args. Returns the number of countries in the zone.

Argument is either a Interchange6::Schema::Result::Country object or an arrayref of the same.

Throws an exception on failure.

Argument is one of:
an Interchange6::Schema::Result::State object
a state ISO code
an arrayref of the above (can include a mixture of both)

Returns the zone object on success.

Argument can be Interchange6::Schema::Result::State, state name or iso code. Returns 1 if zone includes that state else 0;

Takes no args. Returns the number of states in the zone.

Argument is either a Interchange6::Schema::Result::State object or an arrayref of the same.

Returns the Zone object or undef on failure. Errors are available via errors method inherited from Interchange6::Schema::Role::Errors.

2016-07-16 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.