1 #$Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Attic/EasySearch.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
5 RT::EasySearch - a baseclass for RT collection objects
17 ok (require RT::EasySearch);
24 package RT::EasySearch;
25 use DBIx::SearchBuilder;
26 @ISA= qw(DBIx::SearchBuilder);
32 $self->{'user'} = shift;
33 unless(defined($self->CurrentUser)) {
35 Carp::confess("$self was created without a CurrentUser");
36 $RT::Logger->err("$self was created without a CurrentUser\n");
39 $self->SUPER::_Init( 'Handle' => $RT::Handle);
43 # {{{ sub LimitToEnabled
47 Only find items that haven\'t been disabled
54 $self->Limit( FIELD => 'Disabled',
60 # {{{ sub LimitToDisabled
64 Only find items that have been deleted.
71 $self->{'find_disabled_rows'} = 1;
72 $self->Limit( FIELD => 'Disabled',
82 =head2 Limit PARAMHASH
84 This Limit sub calls SUPER::Limit, but defaults "CASESENSITIVE" to 1, thus
85 making sure that by default lots of things don't do extra work trying to
86 match lower(colname) agaist lc($val);
92 my %args = ( CASESENSITIVE => 1,
95 return $self->SUPER::Limit(%args);
102 Returns the current user as an RT::User object.
108 return ($self->{'user'});