PHPExcel_Worksheet_AutoFilter

category | PHPExcel
package | PHPExcel_Worksheet
copyright | Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)

### Methods

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

    __clone()

## Create a new PHPExcel_Worksheet_AutoFilter

    __construct(string $pRange, \PHPExcel_Worksheet $pSheet)

### Parameters

#### $pRange

`string`

Cell range (i.e. A1:E10)

#### $pSheet

`\PHPExcel_Worksheet`

## toString method replicates previous behavior by returning the range if object is referenced as a property of its parent.

    __toString()

## Clear a specified AutoFilter Column

    clearColumn(string $pColumn) : \PHPExcel_Worksheet_AutoFilter

### Parameters

#### $pColumn

`string`

Column name (e.g. A)

### Exceptions

`\PHPExcel_Exception` |

### Returns

`\PHPExcel_Worksheet_AutoFilter`

## Get a specified AutoFilter Column

    getColumn(string $pColumn) : \PHPExcel_Worksheet_AutoFilter_Column

### Parameters

#### $pColumn

`string`

Column name (e.g. A)

### Exceptions

`\PHPExcel_Exception` |

### Returns

`\PHPExcel_Worksheet_AutoFilter_Column`

## Get a specified AutoFilter Column by it's offset

    getColumnByOffset(integer $pColumnOffset) : \PHPExcel_Worksheet_AutoFilter_Column

### Parameters

#### $pColumnOffset

`integer`

Column offset within range (starting from 0)

### Exceptions

`\PHPExcel_Exception` |

### Returns

`\PHPExcel_Worksheet_AutoFilter_Column`

## Get a specified AutoFilter Column Offset within the defined AutoFilter range

    getColumnOffset(string $pColumn) : integer

### Parameters

#### $pColumn

`string`

Column name (e.g. A)

### Exceptions

`\PHPExcel_Exception` |

### Returns

`integer`The offset of the specified column within the autofilter range

## Get all AutoFilter Columns

    getColumns() : array

### Exceptions

`\PHPExcel_Exception` |

### Returns

`array`of PHPExcel_Worksheet_AutoFilter_Column

## Get AutoFilter Parent Worksheet

    getParent() : \PHPExcel_Worksheet

### Returns

`\PHPExcel_Worksheet`

## Get AutoFilter Range

    getRange() : string

### Returns

`string`

## Set AutoFilter

    setColumn(\PHPExcel_Worksheet_AutoFilter_Column | string $pColumn) : \PHPExcel_Worksheet_AutoFilter

### Parameters

#### $pColumn

`\PHPExcel_Worksheet_AutoFilter_Column` `string`

A simple string containing a Column ID like 'A' is permitted

### Exceptions

`\PHPExcel_Exception` |

### Returns

`\PHPExcel_Worksheet_AutoFilter`

## Set AutoFilter Parent Worksheet

    setParent(\PHPExcel_Worksheet $pSheet) : \PHPExcel_Worksheet_AutoFilter

### Parameters

#### $pSheet

`\PHPExcel_Worksheet`

### Returns

`\PHPExcel_Worksheet_AutoFilter`

## Set AutoFilter Range

    setRange(string $pRange) : \PHPExcel_Worksheet_AutoFilter

### Parameters

#### $pRange

`string`

Cell range (i.e. A1:E10)

### Exceptions

`\PHPExcel_Exception` |

### Returns

`\PHPExcel_Worksheet_AutoFilter`

## Shift an AutoFilter Column Rule to a different column

    shiftColumn(string $fromColumn, string $toColumn) : \PHPExcel_Worksheet_AutoFilter

Note: This method bypasses validation of the destination column to ensure it is within this AutoFilter range. Nor does it verify whether any column rule already exists at $toColumn, but will simply overrideany existing value. Use with caution.

### Parameters

#### $fromColumn

`string`

Column name (e.g. A)

#### $toColumn

`string`

Column name (e.g. B)

### Returns

`\PHPExcel_Worksheet_AutoFilter`

## Apply the AutoFilter rules to the AutoFilter Range

    showHideRows() : \PHPExcel_Worksheet_AutoFilter

### Exceptions

`\PHPExcel_Exception` |

### Returns

`\PHPExcel_Worksheet_AutoFilter`

## Validate that the specified column is in the AutoFilter range

    testColumnInRange(string $column) : integer

### Parameters

#### $column

`string`

Column name (e.g. A)

### Exceptions

`\PHPExcel_Exception` |

### Returns

`integer`The column offset within the autofilter range

## _calculateTopTenValue()

    _calculateTopTenValue($columnID, $startRow, $endRow, $ruleType, $ruleValue)

### Parameters

#### $columnID

#### $startRow

#### $endRow

#### $ruleType

#### $ruleValue

## Convert a dynamic rule daterange to a custom filter range expression for ease of calculation

    _dynamicFilterDateRange(string $dynamicRuleType, \PHPExcel_Worksheet_AutoFilter_Column $filterColumn) : mixed[]

### Parameters

#### $dynamicRuleType

`string`

#### $filterColumn

`\PHPExcel_Worksheet_AutoFilter_Column`

&$filterColumn

### Returns

`mixed[]`

## Test if cell value is within a set of values defined by a ruleset

    _filterTestInCustomDataSet(mixed $cellValue, mixed[] $ruleSet) : boolean

Static

### Parameters

#### $cellValue

`mixed`

#### $ruleSet

`mixed[]`

### Returns

`boolean`

## Test if cell value is in the defined set of Excel date values

    _filterTestInDateGroupSet(mixed $cellValue, mixed[] $dataSet) : boolean

Static

### Parameters

#### $cellValue

`mixed`

#### $dataSet

`mixed[]`

### Returns

`boolean`

## Test if cell date value is matches a set of values defined by a set of months

    _filterTestInPeriodDateSet(mixed $cellValue, mixed[] $monthSet) : boolean

Static

### Parameters

#### $cellValue

`mixed`

#### $monthSet

`mixed[]`

### Returns

`boolean`

## Test if cell value is in the defined set of values

    _filterTestInSimpleDataSet(mixed $cellValue, mixed[] $dataSet) : boolean

Static

### Parameters

#### $cellValue

`mixed`

#### $dataSet

`mixed[]`

### Returns

`boolean`

### Properties

##

    $_columns : array

##

    $_fromReplace : array

##

    $_range : string

##

    $_toReplace

##

    $_workSheet : \PHPExcel_Worksheet