AddressBook

 view release on metacpan or  search on metacpan

lib/AddressBook.pm  view on Meta::CPAN

=head2 delete

  $abook->delete($entry)

$entry is an AddressBook::Entry object

=cut

sub delete {
  my $self = shift;
  my $class = ref $self || croak "Not a method call.";

  carp "Method not implemented"
}

=head2 truncate

  $abook->truncate

Removes all records from the database.

=cut

sub truncate {
  my $self = shift;
  my $class = ref $self || croak "Not a method call.";

  carp "Method not implemented"
}

=head2 get_attribute_names 

  @names = $abook->get_attribute_names;

Returns a list of valid backend-specific attribute names

=cut

sub get_attribute_names {
  my $self=shift;
  my $class = ref $self || croak "Not a method call.";
  my %fields = %{$self->{config}->{db2generic}->{$self->{db_name}}};
  my @names = sort {$self->{config}->getMeta(attr=>$fields{$a})->{order} <=> $self->{config}->getMeta(attr=>$fields{$b})->{order}} keys %fields;
  return @names;
}

1;

=head2 get_cannonical_attribute_names 

  @names = $abook->get_cannonical_attribute_names;

Returns a list of valid cannonical attribute names

=cut

sub get_cannonical_attribute_names {
  my $self=shift;
  my $class = ref $self || croak "Not a method call.";
  my @fields = $self->get_attribute_names;
  my @names = map {$self->{config}->{db2generic}->{$self->{db_name}}->{$_}} @fields;
  return @names;
}

1;
__END__

=head1 AUTHOR

Mark A. Hershberger, <mah@everybody.org>
David L. Leigh, <dleigh@sameasiteverwas.net>

=head1 SEE ALSO

  The perl-abook home page at http://perl-abook.sourceforge.net

L<AddressBook::Config>
L<AddressBook::Entry>
    
L<AddressBook::DB::LDAP>
L<AddressBook::DB::LDIF>
L<AddressBook::DB::DBI>
L<AddressBook::DB::PDB>
L<AddressBook::DB::Text>
L<AddressBook::DB::HTML>

=cut



( run in 1.075 second using v1.01-cache-2.11-cpan-39bf76dae61 )