+sub Limit {
+ my $self = shift;
+ my %args = ( ENTRYAGGREGATOR => 'AND',
+ OPERATOR => '=',
+ @_);
+
+ # If we're limiting by target, order by base
+ # (Order by the thing that's changing)
+
+ if ( ($args{'FIELD'} eq 'Target') or
+ ($args{'FIELD'} eq 'LocalTarget') ) {
+ $self->OrderByCols(
+ { ALIAS => 'main', FIELD => 'LocalBase', ORDER => 'ASC' },
+ { ALIAS => 'main', FIELD => 'Base', ORDER => 'ASC' },
+ );
+ }
+ elsif ( ($args{'FIELD'} eq 'Base') or
+ ($args{'FIELD'} eq 'LocalBase') ) {
+ $self->OrderByCols(
+ { ALIAS => 'main', FIELD => 'LocalTarget', ORDER => 'ASC' },
+ { ALIAS => 'main', FIELD => 'Target', ORDER => 'ASC' },
+ );
+ }
+
+
+ $self->SUPER::Limit(%args);