Group extends Model Uses HasUniqueIdentifier
Representation of an individual group and it's filters.
Table of Contents
- $fillable : array<string|int, mixed>
- $timestamps : bool
- $casts : array<string|int, mixed>
- Automatically cast attributes in specific ways.\
- $primaryKey : string
- $table : string
- add_filter() : Group
- Attach a filter to the group.
- delete_filter() : Group
- Remove a specific filter from this group.
- get_filters() : Collection|null
- Get the collection of filters associated to this group.
Properties
$fillable
public
array<string|int, mixed>
$fillable
= ['name', 'priority', 'filters']
$timestamps
public
bool
$timestamps
= \false
$casts
Automatically cast attributes in specific ways.\
protected
array<string|int, mixed>
$casts
= ['filters' => 'array']
$primaryKey
protected
string
$primaryKey
= 'id'
$table
protected
string
$table
= \Barn2\Plugin\WC_Filters\Plugin::META_PREFIX . 'groups'
Methods
add_filter()
Attach a filter to the group.
public
add_filter(Filter $filter) : Group
If the filter has child filters, add those too.
Parameters
- $filter : Filter
Return values
Group —delete_filter()
Remove a specific filter from this group.
public
delete_filter(string $filter_id) : Group
If the filter has child filters, remove the children too.
Parameters
- $filter_id : string
-
id of the filter to remove.
Return values
Group —get_filters()
Get the collection of filters associated to this group.
public
get_filters([bool $exclude_atts = false ][, bool $exclude_atts_parent = false ]) : Collection|null
Exclude the parent "all attributes" filter.
Parameters
- $exclude_atts : bool = false
- $exclude_atts_parent : bool = false