summaryrefslogtreecommitdiff
path: root/LedgerSMB/Location.pm
blob: 69403a7b1d28cc92bd7a7714e14bf57d3cf72cd4 (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 $self = shift;
  28. $AUTOLOAD =~ s/^.*:://;
  29. my $procname = "location_$AUTOLOAD";
  30. $self->exec_method($procname, @_);
  31. }
  32. sub save {
  33. $ref = shift @{$self->exec_method("location_save")};
  34. $self->merge($ref, 'id');
  35. }
  36. sub get {
  37. $ref = shift @{$self->exec_method('location_get')};
  38. $self->merge($ref, keys %{$ref});
  39. }
  40. sub search {
  41. $self->{search_results} = $self->exec_method('location_search');
  42. }
  43. sub list_all {
  44. $self->{search_results} = $self->exec_method('location_list_all');
  45. }