diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-03-08 03:22:22 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-03-08 03:22:22 +0000 |
commit | 3f116c01b5fdce5770258e5a35b82f5d05e8c99a (patch) | |
tree | 89c73ba47772d1871899c4836d86fdcfec1f59b5 /LedgerSMB/DBObject.pm | |
parent | e3938391654168316f393f55a688df29a9a38c48 (diff) |
More ORM changes and HR rewrite
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@861 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB/DBObject.pm')
-rw-r--r-- | LedgerSMB/DBObject.pm | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/LedgerSMB/DBObject.pm b/LedgerSMB/DBObject.pm index 77869f7f..e2441beb 100644 --- a/LedgerSMB/DBObject.pm +++ b/LedgerSMB/DBObject.pm @@ -8,25 +8,28 @@ This module creates object instances based on LedgerSMB's in-database ORM. =head1 METHODS -Most methods are dynamically created. The following methods are static, however. +=item find_method ($hashref, $function_name, @args) -=item make_object hashref, string, -This creates a new data object instance based on information in the PostgreSQL -catalogs. +=head1 Copyright (C) 2007, The LedgerSMB core team. +This file is licensed under the Gnu General Public License version 2, or at your +option any later version. A copy of the license should have been included with +your software. =back =cut -use LedgerSMB; package LedgerSMB::DBObject; +use LedgerSMB; use strict; no strict 'refs'; use warnings; -sub AUTOLOAD { - my ($ref) = shift @_; +@ISA = (LedgerSMB); + +sub exec_method { + my ($self) = shift @_; my ($funcname) = shift @_; my $query = @@ -36,6 +39,11 @@ sub AUTOLOAD { my $ref; $ref = $sth->fetchrow_hashref(NAME_lc); + + if (!$ref){ # no such function + $self->error($locale->text("No such function: ") .$funcname; + die; + } my $m_name = $ref->{proname}; my $args = $ref->{proargnames}; my @proc_args; @@ -53,5 +61,5 @@ sub AUTOLOAD { @proc_args = @_; } } - LedgerSMB::callproc($funcname, @proc_args); + $self->callproc($funcname, @proc_args); } |