+=head2 DeleteEntry { Name => Content => , id => }
+
+Deletes attributes with
+ the matching name
+ and the matching content or id
+
+If Content and id are both undefined, delete all attributes with
+the matching name.
+
+=cut
+
+
+sub DeleteEntry {
+ my $self = shift;
+ my %args = (
+ Name => undef,
+ Content => undef,
+ id => undef,
+ @_
+ );
+ my $found = 0;
+ foreach my $attr ( $self->Named( $args{'Name'} ) ) {
+ if ( ( !defined $args{'id'} and !defined $args{'Content'} )
+ or ( defined $args{'id'} and $attr->id eq $args{'id'} )
+ or ( defined $args{'Content'} and $attr->Content eq $args{'Content'} ) )
+ {
+ my ($id, $msg) = $attr->Delete;
+ return ($id, $msg) unless $id;
+ $found = 1;
+ }
+ }
+ return (0, "No entry found") unless $found;
+ $self->RedoSearch;
+ # XXX: above string must work but because of bug in DBIx::SB it doesn't,
+ # to reproduce delete string below and run t/api/attribute-tests.t
+ $self->_DoSearch;
+ return (1, $self->loc('Attribute Deleted'));
+}