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.
4 package SL::DB::AuthUser;
8 use List::Util qw(first);
10 use SL::DB::MetaSetup::AuthUser;
11 use SL::DB::AuthUserGroup;
13 # Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
14 __PACKAGE__->meta->make_manager_class;
16 __PACKAGE__->meta->schema('auth');
18 __PACKAGE__->meta->add_relationship(
20 type => 'many to many',
21 map_class => 'SL::DB::AuthUserGroup',
26 type => 'one to many',
27 class => 'SL::DB::AuthUserConfig',
28 column_map => { id => 'user_id' },
32 __PACKAGE__->meta->initialize;
34 sub get_config_value {
35 my ($self, $key) = @_;
37 my $cfg = first { $_->cfg_key eq $key } @{ $self->configs };
38 return $cfg ? $cfg->cfg_value : undef;