Kernel::System::Configuration::Helper::List::Filter

NAME

Kernel::System::Configuration::Helper::List::Filter

DESCRIPTION

Helper class/module to filter lists.

has List

Attribute that holds the list.

has Operators

Attribute that holds the available comparison operators.

Run()

Filters the lists, applying the filters. Returns a filtered arrayref.

    my $ArrayRef = $Helper->Run(
        Filters => {
            Name => 'test',
            -or  => [
                Age => 10,
                Age => 15,
            ],
        },
    );

_NormalizeFilters()

Ensures the filters are always an arrayref.

    my $Result = $Self->_NormalizeFilters( {...} );
    my $Result = $Self->_NormalizeFilters( [...] );

_CheckFilters()

Checks the list record against the filters.

    my $Valid = $Self->_CheckFilters(
        {...},   # list record
        [...],   # filters
        'and|or' # flag indicating if is inside and 'AND' or 'OR' block (default: AND)
    );

_BuildOperators()

Initializes the attribute Operators.

Scroll to Top