Groups

Groups helper class.

Tags
author

Barn2 Plugins support@barn2.com

license

GPL-3.0

copyright

Barn2 Media Ltd

Table of Contents

get_filter_groups()  : array<string|int, mixed>
Get a list of filter groups.
get_group_by_id()  : Group|null
Get a filter group by ID.
maybe_attach_filter_children()  : array<string|int, mixed>
When creating a group detect whether or not child filters should be attached too.

Methods

get_filter_groups()

Get a list of filter groups.

public static get_filter_groups() : array<string|int, mixed>
Return values
array<string|int, mixed>

get_group_by_id()

Get a filter group by ID.

public static get_group_by_id(int $group_id) : Group|null
Parameters
$group_id : int
Return values
Group|null

maybe_attach_filter_children()

When creating a group detect whether or not child filters should be attached too.

public static maybe_attach_filter_children(array<string|int, mixed> $ids) : array<string|int, mixed>

How it works: Detects the "all" attribute type of filter and queries the child filters once found, push each child filter right after the parent attribute place into the array so that when the parent attribute is moved around the children follow the same exact position and respect the priority.

Parameters
$ids : array<string|int, mixed>

The filter IDs.

Tags
todo

Add automatic generation of filters for each attribute.

Return values
array<string|int, mixed>

Search results