Revision c377a2da
Von Moritz Bunkus vor fast 14 Jahren hinzugefügt
SL/DB/Employee.pm | ||
---|---|---|
1 |
# This file has been auto-generated only because it didn't exist. |
|
2 |
# Feel free to modify it at will; it will not be overwritten automatically. |
|
3 |
|
|
4 | 1 |
package SL::DB::Employee; |
5 | 2 |
|
6 | 3 |
use strict; |
7 | 4 |
|
8 | 5 |
use SL::DB::MetaSetup::Employee; |
6 |
use SL::DB::Manager::Employee; |
|
9 | 7 |
|
10 |
# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. |
|
11 |
__PACKAGE__->meta->make_manager_class; |
|
12 | 8 |
|
13 | 9 |
1; |
SL/DB/Manager/Employee.pm | ||
---|---|---|
1 |
package SL::DB::Manager::Employee; |
|
2 |
|
|
3 |
use strict; |
|
4 |
|
|
5 |
use SL::DB::Helpers::Manager; |
|
6 |
use base qw(SL::DB::Helpers::Manager); |
|
7 |
|
|
8 |
sub object_class { 'SL::DB::Employee' } |
|
9 |
|
|
10 |
__PACKAGE__->make_manager_methods; |
|
11 |
|
|
12 |
sub current { |
|
13 |
return undef unless $::form && $::form->{login}; |
|
14 |
return shift->find_by(login => $::form->{login}); |
|
15 |
} |
|
16 |
|
|
17 |
1; |
Auch abrufbar als: Unified diff
Manager-Modul für Employee-Model mit Funktion 'current', die die aktuelle Angestellte zurückliefert