1 # This module is part of debbugs, and is released
2 # under the terms of the GPL version 2, or any later version. See the
3 # file README and COPYING for more information.
4 # Copyright 2016 by Don Armstrong <don@donarmstrong.com>.
6 package Debbugs::DB::ResultSet::Arch;
10 Debbugs::DB::ResultSet::Arch - Architecture result set operations
25 use base 'DBIx::Class::ResultSet';
27 # required for hash slices
31 my ($self,@archs) = @_;
33 for my $a ($self->result_source->schema->resultset('Arch')->
35 {result_class => 'DBIx::Class::ResultClass::HashRefInflator',
36 columns => [qw[id arch]],
38 $archs{$a->{arch}} = $a->{id};
40 for my $a (grep {not exists $archs{$_}} @archs) {
42 $self->result_source->schema->resultset('Arch')->
43 find_or_create({arch => $a},
44 {columns => [qw[id arch]],
49 return {%archs{@archs}};