29 lines
486 B
Perl
29 lines
486 B
Perl
package CharmBoard::Schema::Set::Categories;
|
|
|
|
use utf8;
|
|
use strict;
|
|
use warnings;
|
|
use feature qw(say unicode_strings);
|
|
use experimental qw(try smartmatch);
|
|
|
|
use base 'DBIx::Class::ResultSet';
|
|
|
|
sub fetch_all {
|
|
my $set = shift;
|
|
|
|
my $_fetch =
|
|
$set->search({},
|
|
{order_by => 'cat_rank'});
|
|
|
|
return($_fetch->get_column('cat_id')->all)}
|
|
|
|
sub title_from_id {
|
|
my $set = shift;
|
|
|
|
return(
|
|
$set->search({'cat_id' => $_[0]})->
|
|
get_column('cat_name')->first)}
|
|
|
|
1;
|
|
|
|
__END__ |