PHP Class Grido\Components\Filters\Filter

Author: Petr Bugyík
Inheritance: extends Grido\Components\Component
Datei anzeigen Open project: o5/grido

Protected Properties

Property Type Description
$column array
$condition string
$control Nette\Forms\Controls\BaseControl
$formatValue string
$optional mixed
$where callable
$wrapperPrototype Nette\Utils\Html

Public Methods

Method Description
__construct ( Grid $grid, string $name, string $label )
__getCondition ( mixed $value ) : Grido\Components\Filters\Condition | boolean
changeValue ( string $value ) : string Value representation in URI.
getColumn ( ) : array
getCondition ( ) : string
getControl ( ) : BaseControl
getWrapperPrototype ( ) : Nette\Utils\Html Returns wrapper prototype ( html tag).
setColumn ( string $column, string $operator = Condition::OPERATOR_OR ) : Filter Map to database column.
setCondition ( $condition ) : Filter Sets custom condition.
setDefaultValue ( string $value ) : Filter Sets default value.
setFormatValue ( string $format ) : Filter Sets custom format value.
setWhere ( callable $callback ) : Filter Sets custom "sql" where.

Protected Methods

Method Description
formatValue ( string $value ) : string Format value for database.
getFormControl ( )

Method Details

__construct() public method

public __construct ( Grid $grid, string $name, string $label )
$grid Grido\Grid
$name string
$label string

__getCondition() public method

public __getCondition ( mixed $value ) : Grido\Components\Filters\Condition | boolean
$value mixed
return Grido\Components\Filters\Condition | boolean

changeValue() public method

Value representation in URI.
public changeValue ( string $value ) : string
$value string
return string

formatValue() protected method

Format value for database.
protected formatValue ( string $value ) : string
$value string
return string

getColumn() public method

public getColumn ( ) : array
return array

getCondition() public method

public getCondition ( ) : string
return string

getControl() public method

public getControl ( ) : BaseControl
return Nette\Forms\Controls\BaseControl

getFormControl() protected method

protected getFormControl ( )

getWrapperPrototype() public method

Returns wrapper prototype ( html tag).
public getWrapperPrototype ( ) : Nette\Utils\Html
return Nette\Utils\Html

setColumn() public method

Map to database column.
public setColumn ( string $column, string $operator = Condition::OPERATOR_OR ) : Filter
$column string
$operator string
return Filter

setCondition() public method

Sets custom condition.
public setCondition ( $condition ) : Filter
$condition
return Filter

setDefaultValue() public method

Sets default value.
public setDefaultValue ( string $value ) : Filter
$value string
return Filter

setFormatValue() public method

Sets custom format value.
public setFormatValue ( string $format ) : Filter
$format string for example: "%%value%"
return Filter

setWhere() public method

Sets custom "sql" where.
public setWhere ( callable $callback ) : Filter
$callback callable function($value, $source) }
return Filter

Property Details

$column protected_oe property

protected array $column
return array

$condition protected_oe property

protected string $condition
return string

$control protected_oe property

protected BaseControl,Nette\Forms\Controls $control
return Nette\Forms\Controls\BaseControl

$formatValue protected_oe property

protected string $formatValue
return string

$optional protected_oe property

protected mixed $optional
return mixed

$where protected_oe property

protected callable $where
return callable

$wrapperPrototype protected_oe property

protected Html,Nette\Utils $wrapperPrototype
return Nette\Utils\Html