|
NAMEInterchange6::Schema::Result::ZoneDESCRIPTIONIn 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:
The following combinations are NOT allowed:
Countries and states should be added to and removed from the zone using these methods which are described further below:
NOTE: avoid using other methods from DBIx::Class::Relationship::Base since you may inadvertently end up with an invalid zone. ACCESSORSzones_idPrimary Key.zoneFor example for storing the UPS/USPS zone code or a simple name for the zone.Unique constraint. createdDate and time when this record was created returned as DateTime object. Value is auto-set on insert.last_modifiedDate and time when this record was last modified returned as DateTime object. Value is auto-set on insert and update.RELATIONSzone_countriesType: has_manyRelated object: Interchange6::Schema::Result::ZoneCountry countriesType: many_to_manyAccessor to related country results ordered by name. zone_statesType: has_manyRelated object: Interchange6::Schema::Result::ZoneState statesType: many_to_manyAccessor to related state results ordered by name. shipment_destinations"has_many" relationship with Interchange6::Schema::Result::ShipmentDestinationshipment_methods"many_to_many" relationship to shipment_method. Currently it ignores the "active" field in shipment_destinations.METHODSnewOverloaded 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. add_countriesArgument is one of:
Returns the zone object on success. has_countryArgument can be Interchange6::Schema::Result::Country, country name or iso code. Returns 1 if zone includes that country else 0;country_countTakes no args. Returns the number of countries in the zone.remove_countriesArgument is either a Interchange6::Schema::Result::Country object or an arrayref of the same.Throws an exception on failure. add_statesArgument is one of:
Returns the zone object on success. has_stateArgument can be Interchange6::Schema::Result::State, state name or iso code. Returns 1 if zone includes that state else 0;state_countTakes no args. Returns the number of states in the zone.remove_statesArgument 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.
Visit the GSP FreeBSD Man Page Interface. |