Constants

AUTOFILTER_FILTERTYPE_FILTER

AUTOFILTER_FILTERTYPE_FILTER = 'filters'

AUTOFILTER_FILTERTYPE_CUSTOMFILTER

AUTOFILTER_FILTERTYPE_CUSTOMFILTER = 'customFilters'

AUTOFILTER_FILTERTYPE_DYNAMICFILTER

AUTOFILTER_FILTERTYPE_DYNAMICFILTER = 'dynamicFilter'

AUTOFILTER_FILTERTYPE_TOPTENFILTER

AUTOFILTER_FILTERTYPE_TOPTENFILTER = 'top10'

AUTOFILTER_COLUMN_JOIN_AND

AUTOFILTER_COLUMN_JOIN_AND = 'and'

AUTOFILTER_COLUMN_JOIN_OR

AUTOFILTER_COLUMN_JOIN_OR = 'or'

Properties

$filterTypes

$filterTypes : string[]

Types of autofilter rules.

Type

string[]

$ruleJoins

$ruleJoins : string[]

Join options for autofilter rules.

Type

string[]

$parent

$parent : \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter

Autofilter.

Type

AutoFilter

$columnIndex

$columnIndex : string

Autofilter Column Index.

Type

string

$filterType

$filterType : string

Autofilter Column Filter Type.

Type

string

$join

$join : string

Autofilter Multiple Rules And/Or.

Type

string

$ruleset

$ruleset : array

Autofilter Column Rules.

Type

array — of Column\Rule

$attributes

$attributes : array

Autofilter Column Dynamic Attributes.

Type

array — of mixed

Methods

__construct()

__construct(string  $pColumn, \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter  $pParent = null) : mixed

Create a new Column.

Parameters

string $pColumn

Column (e.g. A)

\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter $pParent

Autofilter for this column

Returns

mixed —

getColumnIndex()

getColumnIndex() : string

Get AutoFilter column index as string eg: 'A'.

Returns

string —

setColumnIndex()

setColumnIndex(string  $pColumn) : $this

Set AutoFilter column index as string eg: 'A'.

Parameters

string $pColumn

Column (e.g. A)

Returns

$this —

getParent()

getParent() : \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter

Get this Column's AutoFilter Parent.

Returns

\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter —

setParent()

setParent(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter  $pParent = null) : $this

Set this Column's AutoFilter Parent.

Parameters

\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter $pParent

Returns

$this —

getFilterType()

getFilterType() : string

Get AutoFilter Type.

Returns

string —

setFilterType()

setFilterType(string  $pFilterType) : $this

Set AutoFilter Type.

Parameters

string $pFilterType

Returns

$this —

getJoin()

getJoin() : string

Get AutoFilter Multiple Rules And/Or Join.

Returns

string —

setJoin()

setJoin(string  $pJoin) : $this

Set AutoFilter Multiple Rules And/Or.

Parameters

string $pJoin

And/Or

Returns

$this —

setAttributes()

setAttributes(string[]  $attributes) : $this

Set AutoFilter Attributes.

Parameters

string[] $attributes

Returns

$this —

setAttribute()

setAttribute(string  $pName, string  $pValue) : $this

Set An AutoFilter Attribute.

Parameters

string $pName

Attribute Name

string $pValue

Attribute Value

Returns

$this —

getAttributes()

getAttributes() : string[]

Get AutoFilter Column Attributes.

Returns

string[] —

getAttribute()

getAttribute(string  $pName) : string

Get specific AutoFilter Column Attribute.

Parameters

string $pName

Attribute Name

Returns

string —

getRules()

getRules() : \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule[]

Get all AutoFilter Column Rules.

Returns

\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule[] —

getRule()

getRule(int  $pIndex) : \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule

Get a specified AutoFilter Column Rule.

Parameters

int $pIndex

Rule index in the ruleset array

Returns

\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule —

createRule()

createRule() : \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule

Create a new AutoFilter Column Rule in the ruleset.

Returns

\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule —

addRule()

addRule(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule  $pRule) : $this

Add a new AutoFilter Column Rule to the ruleset.

Parameters

\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule $pRule

Returns

$this —

deleteRule()

deleteRule(int  $pIndex) : $this

Delete a specified AutoFilter Column Rule If the number of rules is reduced to 1, then we reset And/Or logic to Or.

Parameters

int $pIndex

Rule index in the ruleset array

Returns

$this —

clearRules()

clearRules() : $this

Delete all AutoFilter Column Rules.

Returns

$this —

__clone()

__clone() : mixed

Implement PHP __clone to create a deep clone, not just a shallow copy.

Returns

mixed —