+
+sub _all_invalids {
+ my ($trans_id, $configs, %params) = @_;
+
+ require SL::DB::CustomVariableValidity;
+
+ # easy 1: no trans_id, all valid by default.
+ return [] unless $trans_id;
+
+ # easy 2: no module in params? no validity
+ return [] unless $params{module};
+
+ my %wanted_modules = ref $params{module} ? map { $_ => 1 } @{ $params{module} } : ($params{module} => 1);
+ my @module_configs = grep { $wanted_modules{$_->module} } @$configs;
+
+ return [] unless @module_configs;
+
+ # nor find all entries for that and return
+ SL::DB::Manager::CustomVariableValidity->get_all(
+ query => [
+ config_id => [ map { $_->id } @module_configs ],
+ trans_id => $trans_id,
+ ]
+ );
+}
+