Amended category listing
This commit is contained in:
parent
4844174ead
commit
4b4d50de07
3 changed files with 36 additions and 22 deletions
22
lib/Pear/LocalLoop/Schema/ResultSet/Category.pm
Normal file
22
lib/Pear/LocalLoop/Schema/ResultSet/Category.pm
Normal file
|
@ -0,0 +1,22 @@
|
|||
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;
|
||||
}
|
||||
|
||||
1;
|
Reference in a new issue