- LICENSE AND COPYRIGHT
- SEE ALSO
Myco::Base::Entity::SampleEntityAddress - Myco Addresses.
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;
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.
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
evalblock 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 keys, but different people can have the same key. The key is stored internally in lowercase, so 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) 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.
David Wheeler <firstname.lastname@example.org>