summaryrefslogtreecommitdiff
path: root/LedgerSMB/Employee.pm
blob: 9552a8da5312220b0d656a23f6a07bb86e8c3ffd (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. @ISA = (LedgerSMB::DBObject);
  24. sub AUTOLOAD {
  25. my $procname = "employee_$LedgerSMB::Employee::Autoload";
  26. $self->exec_method($procname);
  27. }
  28. sub save {
  29. my $hashref = shift ($self->exec_method("employee_save"));
  30. $self->merge($hashref, 'id');
  31. }
  32. sub get {
  33. my $hashref = shift ($self->exec_method("employee_get"));
  34. $self->merge($hashref, keys $hashref);
  35. }
  36. sub delete {
  37. $self->exec_method("employee_delete");
  38. }
  39. sub list_managers {
  40. $self->{manager_list} = $self->exec_method("employee_list_managers");
  41. }
  42. sub search {
  43. $self->{search_results} = $self->exec_method("employee_search");
  44. }
  45. 1;