| 1 | package Mojolicious::Plugin::RoutesAuthDBI::Model::Roles; | ||
| 2 | #~ use Mojo::Base 'DBIx::Mojo::Model'; | ||
| 3 | use Mojo::Base 'Mojolicious::Plugin::RoutesAuthDBI::Model::Base'; | ||
| 4 | |||
| 5 | #~ sub new { | ||
| 6 | #~ state $self = shift->SUPER::new(@_); | ||
| 7 | #~ } | ||
| 8 | |||
| 9 | sub access { | ||
| 10 | my $self = ref($_[0]) ? shift : shift->new; | ||
| 11 | $self->dbh->selectrow_array($self->sth('access role'), undef, @_); | ||
| 12 | } | ||
| 13 | |||
| 14 | sub get_role { | ||
| 15 | my $self = ref($_[0]) ? shift : shift->new; | ||
| 16 | |||
| 17 | $self->dbh->selectrow_hashref($self->sth('role'), undef, (@_)); | ||
| 18 | |||
| 19 | } | ||
| 20 | |||
| 21 | sub new_role { | ||
| 22 | my $self = ref($_[0]) ? shift : shift->new; | ||
| 23 | |||
| 24 | $self->dbh->selectrow_hashref($self->sth('new role'), undef, (@_)); | ||
| 25 | |||
| 26 | } | ||
| 27 | |||
| 28 | sub dsbl_enbl { | ||
| 29 | my $self = ref($_[0]) ? shift : shift->new; | ||
| 30 | |||
| 31 | $self->dbh->selectrow_hashref($self->sth('dsbl/enbl role'), undef, (@_)); | ||
| 32 | |||
| 33 | } | ||
| 34 | |||
| 35 | sub profiles {# профили роли | ||
| 36 | my $self = ref($_[0]) ? shift : shift->new; | ||
| 37 | $self->dbh->selectall_arrayref($self->sth('role profiles'), { Slice => {} }, (shift)); | ||
| 38 | } | ||
| 39 | |||
| 40 | sub roles { | ||
| 41 | my $self = ref($_[0]) ? shift : shift->new; | ||
| 42 | $self->dbh->selectall_arrayref($self->sth('roles'), { Slice => {} },); | ||
| 43 | } | ||
| 44 | |||
| 45 | 1; | ||
| 46 | |||
| 47 | __DATA__ |