Bug 33159: Simplify ES handling and fix zebra handling
[srvgit] / Koha / Holds.pm
index a4de91c..d4e0b5c 100644 (file)
@@ -34,8 +34,21 @@ Koha::Holds - Koha Hold object set class
 
 =head2 Class methods
 
+=head3 filter_by_found
+
+    my $found_holds = $holds->filter_by_found;
+
+Returns a filtered resultset without holds that are considered I<found>.
+i.e. 'P', 'T' and 'W'.
+
 =cut
 
+sub filter_by_found {
+    my ($self) = @_;
+
+    return $self->search( { found => [ 'P', 'T', 'W' ] } );
+}
+
 =head3 waiting
 
 returns a set of holds that are waiting from an existing set
@@ -48,6 +61,18 @@ sub waiting {
     return $self->search( { found => 'W' } );
 }
 
+=head3 processing
+
+returns a set of holds that are processing from an existing set
+
+=cut
+
+sub processing {
+    my ( $self ) = @_;
+
+    return $self->search( { found => 'P' } );
+}
+
 =head3 unfilled
 
 returns a set of holds that are unfilled from an existing set