diff options
Diffstat (limited to 'LedgerSMB')
-rw-r--r-- | LedgerSMB/DBObject.pm | 12 | ||||
-rw-r--r-- | LedgerSMB/Employee.pm | 14 |
2 files changed, 14 insertions, 12 deletions
diff --git a/LedgerSMB/DBObject.pm b/LedgerSMB/DBObject.pm index 98ad08ad..071acb68 100644 --- a/LedgerSMB/DBObject.pm +++ b/LedgerSMB/DBObject.pm @@ -31,6 +31,18 @@ use warnings; @ISA = (LedgerSMB); +sub new { + my $lsmb = shift @_; + if (! $lsmb->isa(LedgerSMB)){ + $self->error("Constructor called without LedgerSMB object arg"); + my $self = {}; + for $attr (keys $lsmb){ + $self->{$attr} = $lsmb->{$attr}; + } + bless $self; +} + + sub exec_method { my ($self) = shift @_; my ($funcname) = shift @_; diff --git a/LedgerSMB/Employee.pm b/LedgerSMB/Employee.pm index 1165c441..9552a8da 100644 --- a/LedgerSMB/Employee.pm +++ b/LedgerSMB/Employee.pm @@ -38,18 +38,6 @@ sub AUTOLOAD { $self->exec_method($procname); } -sub new { - my $lsmb = shift @_; - if (! $lsmb->isa(LedgerSMB)){ - $self->error("Employee called without LedgerSMB object arg"); - my $self = {}; - for $attr (keys $lsmb){ - $self->{$attr} = $lsmb->{$attr}; - } - bless $self; -} - - sub save { my $hashref = shift ($self->exec_method("employee_save")); $self->merge($hashref, 'id'); @@ -71,3 +59,5 @@ sub list_managers { sub search { $self->{search_results} = $self->exec_method("employee_search"); } + +1; |