This repository has been archived on 2023-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
Foodloop-Server/lib/Pear/LocalLoop/Schema/ResultSet/Category.pm
2021-03-20 12:09:50 +00:00

32 lines
542 B
Perl

package Pear::LocalLoop::Schema::ResultSet::Category;
use strict;
use warnings;
use base 'DBIx::Class::ResultSet';
sub as_hash {
my ($self) = @_;
my %category_list = (
(
map { $_->id => $_->name, } $self->all
),
0 => 'Uncategorised',
);
return \%category_list;
}
sub as_hash_name_icon {
my ($self) = @_;
my %category_list = (
(
map { $_->name => $_->line_icon, } $self->all
),
0 => 'Uncategorised',
);
return \%category_list;
}
1;