summaryrefslogtreecommitdiff
path: root/LedgerSMB
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-03-08 19:02:30 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-03-08 19:02:30 +0000
commit240c36fb8f941248bec8c754dbdf3d61b9e7f6ae (patch)
tree4fe1ef3aafa120fa7dc7e530b1976439f5b2d9cb /LedgerSMB
parent3dd38f98466dedb6710ab5891e75487b195048b9 (diff)
Adding a business location object as well
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@865 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB')
-rw-r--r--LedgerSMB/Location.pm58
1 files changed, 58 insertions, 0 deletions
diff --git a/LedgerSMB/Location.pm b/LedgerSMB/Location.pm
new file mode 100644
index 00000000..c58dbab0
--- /dev/null
+++ b/LedgerSMB/Location.pm
@@ -0,0 +1,58 @@
+=head1 NAME
+
+LedgerSMB::Location - LedgerSMB class for managing Business Locations
+
+=head1 SYOPSIS
+
+This module creates object instances based on LedgerSMB's in-database ORM.
+
+=head1 METHODS
+
+The following method is static:
+=item new ($LedgerSMB object);
+
+The following methods are passed through to stored procedures:
+=item save
+=item get
+=item search
+=item list_all
+=item delete (via Autoload)
+
+The above list may grow over time, and may depend on other installed modules.
+
+=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
+
+package LedgerSMB::Location;
+use LedgerSMB;
+use LedgerSMB::DBObject;
+@ISA = (LedgerSMB::DBObject);
+
+sub AUTOLOAD {
+ my $procname = "location_$LedgerSMB::Location::Autoload";
+ $self->exec_method($procname);
+}
+
+sub save {
+ $ref = shift @{$self->exec_method("location_save")};
+ $self->merge($ref, 'id');
+}
+
+sub get {
+ $ref = shift @{$self->exec_method('location_get')};
+ $self->merge($ref, keys $ref);
+}
+
+sub search {
+ $self->{search_results} = $self->exec_method('location_search');
+}
+
+sub list_all {
+ $self->{search_results} = $self->exec_method('location_list_all');
+}