NAME
DBIx::DataModel::Schema::ResultAs::Categorize - tree of categorized lists of rows
SYNOPSIS
my $tree = $source->select(..., -result_as => [categorize => ($column1, ...)]);
# or
my $tree = $source->select(..., -result_as => [categorize => sub {...}]);
DESCRIPTION
Builds a tree of lists of rows through module List::Categorize, with the content of $column1
, etc. as categorization keys. This is quite similar to the hashref
result kind, except that the categorization keys need not be unique : each leaf of the tree will contain lists of rows matching those categories, while the hashref
result kind only keeps the last row matching the given keys.
Instead of a list of column names, the argument can be a reference to a subroutine. That subroutine will we called for each row and should return a list of scalar values to be used as categorization keys.