SetaPDF_Extractor_Filter_Multi The multi filter allows you to create a filter by several filter instances.
File: /SetaPDF v2/Extractor/Filter/Multi.php
The filters are evaluated by an OR logic by default. If one of the filters match, the item will be accepted. It is also possible to use the filter with an AND logic by passing the mode constant to its snd parameter of the constructor.
Class hierarchy
Implements
Summary
Constants
MODE_AND
A mode constant.
Defines that the filter should work in "and"-mode: All filters have to accept the text item.
MODE_OR
A mode constant.
Defines that the filter should work in "or"-mode: At least one filter have to accept the text item.
Properties
$_filters
protected SetaPDF_Extractor_Filter_FilterInterface[] SetaPDF_Extractor_Filter_Multi::$_filters = array()
The filter instances.e
$_id
protected string|null SetaPDF_Extractor_Filter_Multi::$_id
The id of this filter.
Methods
__construct()
public SetaPDF_Extractor_Filter_Multi::__construct (
[ SetaPDF_Extractor_Filter_FilterInterface|SetaPDF_Extractor_Filter_FilterInterface[] $filters = array (
) [, string $mode = SetaPDF_Extractor_Filter_Multi::MODE_OR [, string|null $id = null ]]]
)The constructor.
Parameters
- $filters : SetaPDF_Extractor_Filter_FilterInterface|SetaPDF_Extractor_Filter_FilterInterface[]
,...
- $mode : string
- $id : string|null
The id for this filter.
accept()
Checks if this filter accepts the text item.
Parameters
- $textItem : SetaPDF_Extractor_TextItem
Return Values
True or false whether the item is accepted or not.
addFilter()
Adds an individual filter.
Parameters
- $filter : SetaPDF_Extractor_Filter_FilterInterface
getFilters()
public SetaPDF_Extractor_Filter_Multi::getFilters (
void
): SetaPDF_Extractor_Filter_FilterInterface[]Get all filters.