WBGP align Address's update method.

Remove unused variables and add some POD to AddressBook.
This commit is contained in:
Colin Kuskie 2008-03-02 16:16:38 +00:00
parent b9cf9c15f7
commit 3da2edb1eb
2 changed files with 12 additions and 13 deletions

View file

@ -213,16 +213,16 @@ The address book that this address belongs to.
sub update {
my ($self, $newProperties) = @_;
my $id = id $self;
$properties{$id}{address2} = (exists $newProperties->{address2}) ? $newProperties->{address2} : $properties{$id}{address2};
$properties{$id}{address3} = (exists $newProperties->{address3}) ? $newProperties->{address3} : $properties{$id}{address3};
$properties{$id}{state} = (exists $newProperties->{state}) ? $newProperties->{state} : $properties{$id}{state};
$properties{$id}{code} = $newProperties->{code} || $properties{$id}{code};
$properties{$id}{city} = $newProperties->{city} || $properties{$id}{city};
$properties{$id}{label} = $newProperties->{label} || $properties{$id}{label};
$properties{$id}{name} = $newProperties->{name} || $properties{$id}{name};
$properties{$id}{country} = $newProperties->{country} || $properties{$id}{country};
$properties{$id}{address1} = $newProperties->{address1} || $properties{$id}{address1};
$properties{$id}{phoneNumber} = $newProperties->{phoneNumber} || $properties{$id}{phoneNumber};
$properties{$id}{address2} = (exists $newProperties->{address2}) ? $newProperties->{address2} : $properties{$id}{address2};
$properties{$id}{address3} = (exists $newProperties->{address3}) ? $newProperties->{address3} : $properties{$id}{address3};
$properties{$id}{state} = (exists $newProperties->{state}) ? $newProperties->{state} : $properties{$id}{state};
$properties{$id}{code} = $newProperties->{code} || $properties{$id}{code};
$properties{$id}{city} = $newProperties->{city} || $properties{$id}{city};
$properties{$id}{label} = $newProperties->{label} || $properties{$id}{label};
$properties{$id}{name} = $newProperties->{name} || $properties{$id}{name};
$properties{$id}{country} = $newProperties->{country} || $properties{$id}{country};
$properties{$id}{address1} = $newProperties->{address1} || $properties{$id}{address1};
$properties{$id}{phoneNumber} = $newProperties->{phoneNumber} || $properties{$id}{phoneNumber};
$properties{$id}{addressBookId} = $self->addressBook->getId;
$self->addressBook->session->db->setRow("address","addressId",$properties{$id});
}

View file

@ -30,7 +30,6 @@ These subroutines are available from this package:
readonly session => my %session;
private properties => my %properties;
private error => my %error;
#-------------------------------------------------------------------
@ -96,7 +95,6 @@ sub create {
# check to see if we're dealing with a registered user or just a visitor
if ($session->user->userId ne "1") {
# check to see if this user or his session already has an address book
my $addressBookId = "";
my @ids = $session->db->buildArray("select addressBookId from addressBook where userId=? or sessionId=?",[$session->user->userId, $session->getId]);
if (scalar(@ids) > 0) {
# how are we looking
@ -151,7 +149,8 @@ Returns a duplicated hash reference of this objects data.
=head3 property
Any field returns the value of a field rather than the hash reference.
Any field returns the value of a field rather than the hash reference. See the
C<update> method.
=cut