SetaPDF_Extractor_Filter_Multi The multi filter allows you to create a filter by several filter instances.

File: /SetaPDF/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

Defines that the filter should work in "and"-mode: All filters have to accept the text item.

MODE_OR

Defines that the filter should work in "or"-mode: At least one filter have to accept the text item.


Properties

$_filters

$_id

protected string|null SetaPDF_Extractor_Filter_Multi::$_id

The id of this filter.

$_mode

protected string SetaPDF_Extractor_Filter_Multi::$_mode = 'or'

The mode to work with.


Methods

__construct()

public SetaPDF_Extractor_Filter_Multi::__construct ( [ SetaPDF_Extractor_Filter_FilterInterface|SetaPDF_Extractor_Filter_FilterInterface[] $filters = array ( ) [, string $mode = self::MODE_OR [, string|null $id = null ]]] )

The constructor.

Parameters
$filters : SetaPDF_Extractor_Filter_FilterInterface|SetaPDF_Extractor_Filter_FilterInterface[]
 
$mode : string
 
$id : string|null

id for this filter.

accept()

public boolean SetaPDF_Extractor_Filter_Multi::accept ( SetaPDF_Extractor_TextItem $textItem )

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()

public void SetaPDF_Extractor_Filter_Multi::addFilter ( SetaPDF_Extractor_Filter_FilterInterface $filter )

Adds an individual filter.

Parameters
$filter : SetaPDF_Extractor_Filter_FilterInterface
 

getFilters()

public SetaPDF_Extractor_Filter_FilterInterface[] SetaPDF_Extractor_Filter_Multi::getFilters ( void )

Get all filters.

getId()

public null|string SetaPDF_Extractor_Filter_Multi::getId ( void )

Get the filter id.

getMode()

public string SetaPDF_Extractor_Filter_Multi::getMode ( void )

Get the mode.

resetFilters()

public void SetaPDF_Extractor_Filter_Multi::resetFilters ( void )

Reset all filters.

setPage()

public void SetaPDF_Extractor_Filter_Multi::setPage ( [ SetaPDF_Core_Document_Page $page = null ] )

Set the current page object for the specific filter.

Parameters
$page : SetaPDF_Core_Document_Page