The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Myco::Base::Entity::SampleEntityAddress - Myco Addresses.

VERSION

$Revision: 1.2 $

DATE

$Date: 2003/12/19 21:52:03 $

SYNOPSIS

  use Myco::User;

  # Constructors.
  my $addr = Myco::Base::Entity::SampleEntityAddress->new;
  # See Myco::Base::Entity for more.

  # Instance Methods.
  my $key = $addr->get_key;
  $addr->set_key($key);
  my $street = $addr->get_street;
  $addr->set_street($street);
  my $city = $addr->get_city;
  $addr->set_city($city);
  my $state = $addr->get_state;
  $addr->set_state($state);
  my $zip = $addr->get_zip;
  $addr->set_zip($zip);
  my $country = $addr->get_country;
  $addr->set_country($country);

  $addr->save;
  $addr->destroy;

DESCRIPTION

Objects of this class represent addresses in Myco. In addition to the typical address parts ach also has a value called "key". This value must be unique across all adddresses for a given person, though different persons can have the same key.

CONSTRUCTORS

See Myco::Base::Entity.

ATTRIBUTES

Attributes may be initially set during object construction (with new()) but otherwise are accessed solely through accessor methods. Typical usage:

  • set

     $obj->set_attr($value);

    This method sets the value of the "attr" attribute. These methods, implemented by Class::Tangram, perform data validation. If there is any concern that the set method might be called with invalid data then the call should be wrapped in an eval block to catch exceptions that would result.

  • get

     $value = $obj->get_attr;

    This method returns the value of the "attr" attribute.

A listing of available attributes follows:

key

 type: string(32)  default value: 'home'

A short descripter that uniquely describes an address on a per-person bases. All addresses associated with a single person must have different keys, but different people can have the same key. The key is stored internally in lowercase, so key matches are case-insensitive.

street

 type: string(159)

The street portion of the address. May be multiple lines by using new line characters.

city

 type: string(128)

The address city.

state

 type: string(2)

The address state or province.

zip

 type: string(16)

The address postal code.

country

 type: string(64)

The address country. preferrably specified as an ISO 3166-1 two-letter code.

LICENSE AND COPYRIGHT

Copyright (c) 2004 the myco project. All rights reserved. This software is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

David Wheeler <david@wheeler.net>

SEE ALSO

Myco::Base::Entity, Tangram, Class::Tangram, Lingua::Strfname.