| Pangloss documentation | Contained in the Pangloss distribution. |
Pangloss::Search::Filter - abstract search filter
# abstract - must be sub-classed for use
use Pangloss::Search::Filter::Foo;
my $filter = $Pangloss::Search::Filter::Foo->new;
do { ... } if $filter->parent( $self )->applies_to( $term );
An abstract search filter object.
abstract. test to see if this filter applies to the Pangloss::Term given.
a return value of true indicates that the $term should be added to the
result set.
get/set this filter's parent Pangloss::Search.
At the very least, you must do the following:
package Foo;
use base qw( Pangloss::Search::Filter );
sub applies_to {
my $self = shift;
my $term = shift;
# use $term and the collections available
# via $self->parent to do your test
return 0 || 1;
}
Pangloss::Search will set $self->parent() before it calls applies_to().
Steve Purkis <spurkis@quiup.com>
Pangloss::Search::Filter::Base, Pangloss::Search::Filter::Keywords
| Pangloss documentation | Contained in the Pangloss distribution. |
package Pangloss::Search::Filter; use Error; use OpenFrame::WebApp::Error::Abstract; use base qw( Pangloss::Object ); use accessors qw( parent ); our $VERSION = ((require Pangloss::Version), $Pangloss::VERSION)[1]; our $REVISION = (split(/ /, ' $Revision: 1.9 $ '))[2]; sub applies_to { my $class = shift->class; throw OpenFrame::WebApp::Error::Abstract( class => $class ); } 1; __END__ #------------------------------------------------------------------------------