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

[email protected] (Stephen Adkins)
Newsgroups perl.cvs.p5ee
Message-ID <[email protected]>
cvsuser     06/02/10 10:07:41

  Modified:    App-WorkQueue/lib/App/WorkQueue Repository.pm
  Log:
  added _located_in_db() [oops]
  
  Revision  Changes    Path
  1.7       +29 -1     p5ee/App-WorkQueue/lib/App/WorkQueue/Repository.pm
  
  Index: Repository.pm
  ===================================================================
  RCS file: /cvs/public/p5ee/App-WorkQueue/lib/App/WorkQueue/Repository.pm,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Repository.pm	8 Feb 2006 21:54:50 -0000	1.6
  +++ Repository.pm	10 Feb 2006 18:07:41 -0000	1.7
  @@ -306,6 +306,34 @@
       return(@entries);
   }
   
  +sub _locate_in_db {
  +    &App::sub_entry if ($App::trace);
  +    my ($self, $params, $options) = @_;
  +
  +    my %params = %$params;
  +
  +    my $STATUS_UNBUFFERED = $self->{STATUS_UNBUFFERED};
  +    my $STATUS_UNACQUIRED = $self->{STATUS_UNACQUIRED};
  +    my $STATUS_ACQUIRED   = $self->{STATUS_ACQUIRED};
  +    my $status_attrib     = $self->{status_attrib};
  +    $params{$status_attrib} = "$STATUS_UNBUFFERED,$STATUS_UNACQUIRED,$STATUS_ACQUIRED";
  +    if ($self->{queue_id_attrib} && $self->{queue_id}) {
  +        $params{$self->{queue_id_attrib}} = $self->{queue_id};
  +    }
  +    my ($entries);
  +    my $db = $self->_db();
  +
  +    if ($self->{type} eq "ARRAY") {
  +        $entries = $db->get_rows($self->{table}, \%params, $self->{columns});
  +    }
  +    else {
  +        $entries = $db->get_hashes($self->{table}, \%params, $self->{columns});
  +    }
  +
  +    &App::sub_exit(@$entries) if ($App::trace);
  +    return(@$entries);
  +}
  +
   sub update {
       &App::sub_entry if ($App::trace);
       my ($self, $entry, $columns, $values) = @_;
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.