Myco::Entity::SampleEntityAddress - Myco Addresses.
use Myco::User; # Constructors. my $addr = Myco::Entity::SampleEntityAddress->new; # See Myco::Entity for more. # Instance Methods. my $address_key = $addr->get_address_key; $addr->set_address_key($address_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;
Objects of this class represent addresses in Myco - in fact, the entire class is a ripoff of Myco::Address. In addition to the typical address parts each also has a value called "address_key". This value must be unique across all addresses for a given person, though different persons can have the same address_key.
Attributes may be initially set during object construction (with
new()) but otherwise are accessed solely through accessor methods. Typical usage:
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.
$value = $obj->get_attr;
This method returns the value of the "attr" attribute.
A listing of available attributes follows:
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 address_keys, but different people can have the same address_key. The address_key is stored internally in lowercase, so address_key matches are case-insensitive.
The street portion of the address. May be multiple lines by using new line characters.
The address city.
The address state or province.
The address postal code.
The address country. preferrably specified as an ISO 3166-1 two-letter code.
Copyright (c) 2006 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.
David Wheeler <email@example.com>