[Rt-commit] r19474 - rt/3.999/trunk/lib/RT
sartak at bestpractical.com
sartak at bestpractical.com
Wed May 6 14:38:42 EDT 2009
Author: sartak
Date: Wed May 6 14:38:41 2009
New Revision: 19474
Modified:
rt/3.999/trunk/lib/RT/Collection.pm
Log:
Remove unused and fairly insane limit_attribute
Modified: rt/3.999/trunk/lib/RT/Collection.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Collection.pm (original)
+++ rt/3.999/trunk/lib/RT/Collection.pm Wed May 6 14:38:41 2009
@@ -91,95 +91,6 @@
);
}
-=head2 limit_attribute PARAMHASH
-
-Takes name, operator and value to find records that has the
-matching Attribute.
-
-If EMPTY is set, also select rows with an empty string as
-Attribute's Content.
-
-If NULL is set, also select rows without the named Attribute.
-
-=cut
-
-my %Negate = (
- '=' => '!=',
- '!=' => '=',
- '>' => '<=',
- '<' => '>=',
- '>=' => '<',
- '<=' => '>',
- 'LIKE' => 'NOT LIKE',
- 'NOT LIKE' => 'LIKE',
- 'IS' => 'IS NOT',
- 'IS NOT' => 'IS',
-);
-
-sub limit_attribute {
- my ( $self, %args ) = @_;
- my $clause = 'alias';
- my $operator = ( $args{operator} || '=' );
-
- if ( $args{NULL} and exists $args{value} ) {
- $clause = 'leftjoin';
- $operator = $Negate{$operator};
- } elsif ( $args{NEGATE} ) {
- $operator = $Negate{$operator};
- }
-
- my $alias = $self->join(
- type => 'left',
- alias1 => $args{alias} || 'main',
- column1 => 'id',
- table2 => 'Attributes',
- column2 => 'object_id'
- );
-
- my $type = ref($self);
- $type =~ s/(?:s|Collection)$//; # XXX - Hack!
-
- $self->limit(
- $clause => $alias,
- column => 'object_type',
- operator => '=',
- value => $type,
- );
- $self->limit(
- $clause => $alias,
- column => 'name',
- operator => '=',
- value => $args{name},
- ) if exists $args{name};
-
- return unless exists $args{value};
-
- $self->limit(
- $clause => $alias,
- column => 'content',
- operator => $operator,
- value => $args{value},
- );
-
- # Capture rows with the attribute defined as an empty string.
- $self->limit(
- $clause => $alias,
- column => 'content',
- operator => '=',
- value => '',
- entry_aggregator => $args{NULL} ? 'AND' : 'OR',
- ) if $args{EMPTY};
-
- # Capture rows without the attribute defined
- $self->limit(
- %args,
- alias => $alias,
- column => 'id',
- operator => ( $args{NEGATE} ? 'IS NOT' : 'IS' ),
- value => 'NULL',
- ) if $args{NULL};
-}
-
=head2 limit_custom_field
Takes a paramhash of key/value pairs with the following keys:
More information about the Rt-commit
mailing list