NAME
Myco::Entity::SampleEntityAddress - Myco Addresses.
SYNOPSIS
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;
DESCRIPTION
This class, along with Myco::Entity::SampleEntityBase and Myco::Entity::SampleEntityAddress, provide the basis for all tests provided with the core myco system.
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.
CONSTRUCTORS
See Myco::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:
address_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 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.
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) 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.
AUTHOR
David Wheeler <david@wheeler.net>