cvs commit: p5ee/App-Repository/lib/App RepositoryObject.pm

[email protected] (Stephen Adkins)
Newsgroups perl.cvs.p5ee
Message-ID <[email protected]>
cvsuser     05/08/09 11:54:33

  Modified:    App-Repository/lib/App RepositoryObject.pm
  Log:
  delete()
  
  Revision  Changes    Path
  1.4       +29 -1     p5ee/App-Repository/lib/App/RepositoryObject.pm
  
  Index: RepositoryObject.pm
  ===================================================================
  RCS file: /cvs/public/p5ee/App-Repository/lib/App/RepositoryObject.pm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RepositoryObject.pm	12 Oct 2004 14:09:09 -0000	1.3
  +++ RepositoryObject.pm	9 Aug 2005 18:54:33 -0000	1.4
  @@ -147,6 +147,34 @@
       return($nrows);
   }
   
  +#############################################################################
  +# delete()
  +#############################################################################
  +
  +=head2 delete()
  +
  +    * Signature: $obj->delete();
  +    * Signature: $obj->delete($options);
  +    * Param:     $options        ARRAY
  +    * Throws:    App::Exception
  +    * Since:     0.01
  +
  +    Sample Usage: 
  +
  +    $obj->delete();
  +
  +Deletes the object out of the repository.
  +
  +=cut
  +
  +sub delete {
  +    my ($self, $options) = @_;
  +    die "Can't delete values: _key not defined on object[$self->{_table}]" if (! defined $self->{_key});
  +    my $nrows = $self->{_repository}->delete($self->{_table}, $self->{_key}, undef, undef, $options);
  +    die "Can't delete() on object[$self->{_table}.$self->{_key}]" if (!$nrows);
  +    return($nrows);
  +}
  +
   =head1 ACKNOWLEDGEMENTS
   
    * Author:  Stephen Adkins <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.