diff options
Diffstat (limited to 'LedgerSMB')
-rw-r--r-- | LedgerSMB/DBObject.pm | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/LedgerSMB/DBObject.pm b/LedgerSMB/DBObject.pm index 2b4b35da..63c27f7c 100644 --- a/LedgerSMB/DBObject.pm +++ b/LedgerSMB/DBObject.pm @@ -47,7 +47,8 @@ sub AUTOLOAD { $type =~ m/::(.*?)$/; $type = lc $1; print "Type: $type\n"; - $self->exec_method( procname => "$type" . "_" . $AUTOLOAD, args => \@_ ); + $self->exec_method( procname => "$type" . "_" . $AUTOLOAD, args => \@_ + order_by => $order_by); } sub new { @@ -64,8 +65,19 @@ sub new { $self; } +sub set_ordering { + my $self = shift @_; + my %args = @_; + + if (not defined $self->{_order_method}){ + $self->{_order_method} = {}; + } + + $self->{_order_method}->{$args{method}} = $args{column}; +} + sub exec_method { - my ($self) = shift @_; + my $self = shift @_; my %args = @_; my $funcname = $args{funcname}; my @in_args = @{ $args{args} }; |