summaryrefslogtreecommitdiff
path: root/LedgerSMB/Employee.pm
blob: 261d9578a8ea516784de563873999a438a61cf33 (plain)
  1. =head1 NAME
  2. LedgerSMB::Employee - LedgerSMB class for managing Employees
  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 via Autoload.
  9. =item save
  10. =item get
  11. =item search
  12. =item list_managers
  13. The above list may grow over time, and may depend on other installed modules.
  14. =head1 Copyright (C) 2007, The LedgerSMB core team.
  15. This file is licensed under the Gnu General Public License version 2, or at your
  16. option any later version. A copy of the license should have been included with
  17. your software.
  18. =back
  19. =cut
  20. package LedgerSMB::Employee;
  21. use LedgerSMB;
  22. use LedgerSMB::DBObject;
  23. use strict;
  24. our $VERSION = '1.0.0';
  25. our @ISA = qw(LedgerSMB::DBObject);
  26. sub AUTOLOAD {
  27. my $self = shift;
  28. my $AUTOLOAD = $LedgerSMB::Employee::AUTOLOAD;
  29. $AUTOLOAD =~ s/^.*:://;
  30. my $procname = "employee_$AUTOLOAD";
  31. $self->exec_method(procname => "employee_$AUTOLOAD", args => \@_);
  32. my @call_args;
  33. }
  34. sub save {
  35. my $self = shift;
  36. my $hashref = shift @{$self->exec_method(procname => "employee_save")};
  37. $self->merge($hashref, 'id');
  38. }
  39. sub get {
  40. my $self = shift;
  41. my $hashref = shift @{$self->exec_method(procname => "employee_get")};
  42. $self->merge($hashref, keys %{$hashref});
  43. }
  44. sub list_managers {
  45. my $self = shift;
  46. $self->{manager_list} = $self->exec_method(procname => "employee_list_managers");
  47. }
  48. sub search {
  49. my $self = shift;
  50. $self->{search_results} = $self->exec_method(procname => "employee_search");
  51. }
  52. 1;