summaryrefslogtreecommitdiff
path: root/LedgerSMB/Location.pm
blob: c58dbab0af56dcd1e6168a77a6ec7bb5d1304ee7 (plain)
  1. =head1 NAME
  2. LedgerSMB::Location - LedgerSMB class for managing Business Locations
  3. =head1 SYOPSIS
  4. This module creates object instances based on LedgerSMB's in-database ORM.
  5. =head1 METHODS
  6. The following method is static:
  7. =item new ($LedgerSMB object);
  8. The following methods are passed through to stored procedures:
  9. =item save
  10. =item get
  11. =item search
  12. =item list_all
  13. =item delete (via Autoload)
  14. The above list may grow over time, and may depend on other installed modules.
  15. =head1 Copyright (C) 2007, The LedgerSMB core team.
  16. This file is licensed under the Gnu General Public License version 2, or at your
  17. option any later version. A copy of the license should have been included with
  18. your software.
  19. =back
  20. =cut
  21. package LedgerSMB::Location;
  22. use LedgerSMB;
  23. use LedgerSMB::DBObject;
  24. @ISA = (LedgerSMB::DBObject);
  25. sub AUTOLOAD {
  26. my $procname = "location_$LedgerSMB::Location::Autoload";
  27. $self->exec_method($procname);
  28. }
  29. sub save {
  30. $ref = shift @{$self->exec_method("location_save")};
  31. $self->merge($ref, 'id');
  32. }
  33. sub get {
  34. $ref = shift @{$self->exec_method('location_get')};
  35. $self->merge($ref, keys $ref);
  36. }
  37. sub search {
  38. $self->{search_results} = $self->exec_method('location_search');
  39. }
  40. sub list_all {
  41. $self->{search_results} = $self->exec_method('location_list_all');
  42. }