summaryrefslogtreecommitdiff
path: root/LedgerSMB/Location.pm
blob: 95128e519b54e98c32f30df1d4d23e69b79d7bcc (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. our $VERSION = '1.0.0';
  25. our @ISA = qw(LedgerSMB::DBObject);
  26. sub AUTOLOAD {
  27. my $procname = "location_$LedgerSMB::Location::Autoload";
  28. $self->exec_method($procname);
  29. }
  30. sub save {
  31. $ref = shift @{$self->exec_method("location_save")};
  32. $self->merge($ref, 'id');
  33. }
  34. sub get {
  35. $ref = shift @{$self->exec_method('location_get')};
  36. $self->merge($ref, keys %{$ref});
  37. }
  38. sub search {
  39. $self->{search_results} = $self->exec_method('location_search');
  40. }
  41. sub list_all {
  42. $self->{search_results} = $self->exec_method('location_list_all');
  43. }