Revision fe546cb0
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
SL/Controller/Helper/ParseFilter.pm | ||
---|---|---|
22 | 22 |
|
23 | 23 |
my %methods = ( |
24 | 24 |
enable => sub { ;;;; }, |
25 |
eq_ignore_empty => sub { ($_[0] // '') eq '' ? () : +{ eq => $_[0] } }, |
|
25 | 26 |
map { |
26 | 27 |
# since $_ is an alias it can't be used in a closure. even "".$_ or "$_" |
27 | 28 |
# does not work, we need a real copy. |
... | ... | |
383 | 384 |
|
384 | 385 |
Adds "% .. %" around the search string. |
385 | 386 |
|
387 |
=item eq_ignore_empty |
|
388 |
|
|
389 |
Ignores this item if it's empty. Otherwise compares it with the |
|
390 |
standard SQL C<=> operator. |
|
391 |
|
|
386 | 392 |
=back |
387 | 393 |
|
388 | 394 |
=head2 METHODS (leading with ::) |
Auch abrufbar als: Unified diff
ParseFilter: neuer Operator 'eq_ignore_empty'
Ignoriert den Filter, wenn er leer ist. Andernfalls wird mit =
verglichen.