Revision 21436d8b
Von Thomas Heck vor mehr als 11 Jahren hinzugefügt
SL/DB/Helper/CustomVariables.pm | ||
---|---|---|
78 | 78 |
my $cvars = $self->custom_variables; |
79 | 79 |
my %cvars_by_config = map { $_->config_id => $_ } @$cvars; |
80 | 80 |
|
81 |
my @return = map { $cvars_by_config{$_->id} || _new_cvar($self, %params, config => $_) } @$configs; |
|
81 |
my @return = map( |
|
82 |
{ |
|
83 |
if ( $cvars_by_config{$_->id} ) { |
|
84 |
$cvars_by_config{$_->id}; |
|
85 |
} |
|
86 |
else { |
|
87 |
my $cvar = _new_cvar($self, %params, config => $_); |
|
88 |
$self->add_custom_variables($cvar); |
|
89 |
$cvar; |
|
90 |
} |
|
91 |
} |
|
92 |
@$configs |
|
93 |
); |
|
82 | 94 |
|
83 | 95 |
return \@return; |
84 | 96 |
} |
Auch abrufbar als: Unified diff
CustomVariables-Helper registrieren von neu erstellen CVars
SL::DB::Helper::CustomVariables::cvars_by_config fügt neue CVars
dem ursprünglichen Objekt hinzu.