| 1 | package Mojolicious::Plugin::RoutesAuthDBI::Model::Refs; | ||
| 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 exists { | ||
| 10 | my $self = ref($_[0]) ? shift : shift->new; | ||
| 11 | |||
| 12 | $self->dbh->selectrow_array($self->sth('exists refs'), undef, (shift, shift)); | ||
| 13 | } | ||
| 14 | |||
| 15 | sub refer { | ||
| 16 | my $self = ref($_[0]) ? shift : shift->new; | ||
| 17 | |||
| 18 | $self->dbh->selectrow_hashref($self->sth('ref'), undef, (@_)) | ||
| 19 | || $self->dbh->selectrow_hashref($self->sth('new ref'), undef, (@_)); | ||
| 20 | |||
| 21 | } | ||
| 22 | |||
| 23 | sub del { | ||
| 24 | my $self = ref($_[0]) ? shift : shift->new; | ||
| 25 | |||
| 26 | $self->dbh->selectrow_hashref($self->sth('del ref'), undef, (@_)); | ||
| 27 | } | ||
| 28 | |||
| 29 | 1; | ||
| 30 | |||
| 31 | __DATA__ |