summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-03-08 07:07:47 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-03-08 07:07:47 +0000
commitd390dfaf0f4a27463cc462a1fc8e058d91a29584 (patch)
tree5f30b3400f0c791a55157c166395540ea68e2e65
parent3f116c01b5fdce5770258e5a35b82f5d05e8c99a (diff)
refactoring some methods and getting rid of unnecessary multiple inheritance
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@862 4979c152-3d1c-0410-bac9-87ea11338e46
-rw-r--r--LedgerSMB/DBObject.pm5
-rw-r--r--LedgerSMB/Employee.pm13
2 files changed, 6 insertions, 12 deletions
diff --git a/LedgerSMB/DBObject.pm b/LedgerSMB/DBObject.pm
index e2441beb..98ad08ad 100644
--- a/LedgerSMB/DBObject.pm
+++ b/LedgerSMB/DBObject.pm
@@ -10,6 +10,9 @@ This module creates object instances based on LedgerSMB's in-database ORM.
=item find_method ($hashref, $function_name, @args)
+=item merge ($hashref, @attrs)
+copies @attrs from $hashref to $self.
+
=head1 Copyright (C) 2007, The LedgerSMB core team.
This file is licensed under the Gnu General Public License version 2, or at your
@@ -63,3 +66,5 @@ sub exec_method {
}
$self->callproc($funcname, @proc_args);
}
+
+
diff --git a/LedgerSMB/Employee.pm b/LedgerSMB/Employee.pm
index 007b44d5..1165c441 100644
--- a/LedgerSMB/Employee.pm
+++ b/LedgerSMB/Employee.pm
@@ -11,9 +11,6 @@ This module creates object instances based on LedgerSMB's in-database ORM.
The following method is static:
=item new ($LedgerSMB object);
-=item merge ($hashref, @attrs)
-copies @attrs from $hashref to $self.
-
The following methods are passed through to stored procedures via Autoload.
=item save
=item get
@@ -34,7 +31,7 @@ your software.
package LedgerSMB::Employee;
use LedgerSMB;
use LedgerSMB::DBObject;
-@ISA = (LedgerSMB, LedgerSMB::DBObject);
+@ISA = (LedgerSMB::DBObject);
sub AUTOLOAD {
my $procname = "employee_$LedgerSMB::Employee::Autoload";
@@ -53,14 +50,6 @@ sub new {
}
-sub merge {
- my $self = shift @_;
- my $src = shift @_;
- for $arg (@_){
- $self->{$arg} = $src->{$arg};
- }
-}
-
sub save {
my $hashref = shift ($self->exec_method("employee_save"));
$self->merge($hashref, 'id');