From a9406a2d77b97792b9deb6e3c80e5cdb31b7010a Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 9 Jul 2015 14:32:23 +0200 Subject: [PATCH] =?utf8?q?GetModels=20Filtered:=20gelaunderten=20Filter=20?= =?utf8?q?im=20Plugin=20zur=20Verf=C3=BCgung=20stellen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/Helper/GetModels/Filtered.pm | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/SL/Controller/Helper/GetModels/Filtered.pm b/SL/Controller/Helper/GetModels/Filtered.pm index 642d542a0..eaf740461 100644 --- a/SL/Controller/Helper/GetModels/Filtered.pm +++ b/SL/Controller/Helper/GetModels/Filtered.pm @@ -9,7 +9,7 @@ use List::MoreUtils qw(uniq); use Rose::Object::MakeMethods::Generic ( scalar => [ qw(filter_args filter_params orig_filter filter) ], - 'scalar --get_set_init' => [ qw(form_params launder_to) ], + 'scalar --get_set_init' => [ qw(form_params launder_to laundered) ], ); sub init { @@ -60,6 +60,9 @@ sub read_params { } } + # Store laundered result in $self->laundered. + $self->laundered($laundered // $filter) unless $parse_filter_args{no_launder}; + # $::lxdebug->dump(0, "get_current_filter_params: ", \%calculated_params); $self->filter_params(\%calculated_params); @@ -111,6 +114,12 @@ sub init_launder_to { 'filter' } +sub init_laundered { + my ($self) = @_; + + $self->get_models->finalize; + return $self->{laundered}; +} 1; @@ -185,6 +194,18 @@ See L for a description of the filter forma C will honor custom filters defined in RDBO managers. See L for an explanation fo those. +=head1 FUNCTIONS + +=over 4 + +=item C + +Finalizes the object (which causes laundering of the filter structure) +and returns a hashref of the laundered filter. If the plugin is +configured not to launder then C will be returned. + +=back + =head1 BUGS =over 4 -- 2.20.1