summaryrefslogtreecommitdiff
path: root/LedgerSMB/Employee.pm
blob: dd74be75f92edfa6923c1c398bb2cb1e26d2d3b7 (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 base qw(LedgerSMB::DBObject);
  22. use strict;
  23. our $VERSION = '1.0.0';
  24. sub save {
  25. my $self = shift;
  26. my $hashref = shift @{ $self->exec_method( procname => "employee_save" ) };
  27. $self->merge( $hashref, 'id' );
  28. }
  29. sub get {
  30. my $self = shift;
  31. my $hashref = shift @{ $self->exec_method( procname => "employee_get" ) };
  32. $self->merge( $hashref, keys %{$hashref} );
  33. }
  34. sub list_managers {
  35. my $self = shift;
  36. $self->{manager_list} =
  37. $self->exec_method( procname => "employee_list_managers" );
  38. }
  39. sub search {
  40. my $self = shift;
  41. $self->{search_results} =
  42. $self->exec_method( procname => "employee_search" );
  43. }
  44. 1;