Overview

Namespaces

  • Charcoal
    • Loader
    • Model
      • Service
      • ServiceProvider
    • Source
      • Database
    • Validator

Classes

  • AbstractSource
  • DatabaseSource
  • DatabaseSourceConfig
  • Filter
  • Order
  • Pagination
  • SourceConfig

Interfaces

  • DatabaseSourceInterface
  • FilterInterface
  • OrderInterface
  • PaginationInterface
  • SourceInterface
  • StorableInterface

Traits

  • StorableTrait
  • Overview
  • Namespace
  • Class

Class Filter

Filter

Charcoal\Source\Filter implements Charcoal\Source\FilterInterface

Direct known subclasses

Charcoal\Source\Database\DatabaseFilter
Namespace: Charcoal\Source
Located at Charcoal/Source/Filter.php
Methods summary
public Charcoal\Source\Filter
# setData( array $data )

Parameters

$data
The filter data.

Returns

Charcoal\Source\Filter
Chainable

Implementation of

Charcoal\Source\FilterInterface::setData()
public Charcoal\Source\Filter
# setProperty( string $property )

Parameters

$property
The filter property.

Returns

Charcoal\Source\Filter
(Chainable)

Throws

InvalidArgumentException
If the property argument is not a string.

Implementation of

Charcoal\Source\FilterInterface::setProperty()
public string
# property( )

Returns

string

Implementation of

Charcoal\Source\FilterInterface::property()
public Charcoal\Source\Filter
# setVal( mixed $val )

Parameters

$val
The filter value.

Returns

Charcoal\Source\Filter
(Chainable)

Implementation of

Charcoal\Source\FilterInterface::setVal()
public mixed
# val( )

Returns

mixed

Implementation of

Charcoal\Source\FilterInterface::val()
public mixed
# parseVal( mixed $val )

Parse the given value.

Parse the given value.

Parameters

$val
The value to be parsed (normalized).

Returns

mixed
Returns the parsed value.
public Charcoal\Source\Filter
# setOperator( string $operator )

Parameters

$operator
The filter operator.

Returns

Charcoal\Source\Filter
(Chainable)

Throws

InvalidArgumentException
If the parameter is not a valid operator.

Implementation of

Charcoal\Source\FilterInterface::setOperator()
public string
# operator( )

Returns

string

Implementation of

Charcoal\Source\FilterInterface::operator()
public Charcoal\Source\Filter
# setFunc( string $func )

Parameters

$func
The filter function.

Returns

Charcoal\Source\Filter
(Chainable)

Throws

InvalidArgumentException
If the parameter is not a valid function.

Implementation of

Charcoal\Source\FilterInterface::setFunc()
public string
# func( )

Returns

string

Implementation of

Charcoal\Source\FilterInterface::func()
public Charcoal\Source\Filter
# setOperand( string $operand )

Parameters

$operand
The filter operand.

Returns

Charcoal\Source\Filter
(Chainable)

Throws

InvalidArgumentException
If the parameter is not a valid operand.

Implementation of

Charcoal\Source\FilterInterface::setOperand()
public string
# operand( )

Returns

string

Implementation of

Charcoal\Source\FilterInterface::operand()
public Charcoal\Source\Filter
# setTableName( string $tableName )

Parameters

$tableName
The filter table name.

Returns

Charcoal\Source\Filter
(Chainable)

Throws

InvalidArgumentException
If the parameter is not a string.

Implementation of

Charcoal\Source\FilterInterface::setTableName()
public string
# tableName( )

Returns

string

Implementation of

Charcoal\Source\FilterInterface::tableName()
public Charcoal\Source\Filter
# setString( string $sql )

Parameters

$sql
The custom filter SQL string.

Returns

Charcoal\Source\Filter
(Chainable)

Throws

InvalidArgumentException
If the parameter is not a valid operand.

Implementation of

Charcoal\Source\FilterInterface::setString()
public string
# string( )

Returns

string

Implementation of

Charcoal\Source\FilterInterface::string()
public Charcoal\Source\Filter
# setActive( boolean $active )

Parameters

$active
The active flag.

Returns

Charcoal\Source\Filter
(Chainable)

Implementation of

Charcoal\Source\FilterInterface::setActive()
public boolean
# active( )

Returns

boolean

Implementation of

Charcoal\Source\FilterInterface::active()
protected array
# validOperators( )

Supported operators

Supported operators

Returns

array
protected array
# validOperands( )

Supported operand types, uppercase

Supported operand types, uppercase

Returns

array
protected array
# validFunc( )

Supported functions, uppercase

Supported functions, uppercase

Returns

array
Constants summary
string DEFAULT_OPERATOR
# '='
string DEFAULT_FUNC
# ''
string DEFAULT_OPERAND
# 'AND'
string DEFAULT_TABLE_NAME
# 'objTable'
Properties summary
protected string $property

$property

$property

#
protected mixed $val

$val

$val

#
protected string $operator

$operator

$operator

# Charcoal\Source\Filter::DEFAULT_OPERATOR
protected string $func

$func

$func

# Charcoal\Source\Filter::DEFAULT_FUNC
protected string $operand

$operand

$operand

# Charcoal\Source\Filter::DEFAULT_OPERAND
protected string $tableName

$tableName

$tableName

# Charcoal\Source\Filter::DEFAULT_TABLE_NAME
protected string $string

Raw SQL clause.

Raw SQL clause.

#
protected boolean $active

Inactive filter should be skipped completely.

Inactive filter should be skipped completely.

#
API documentation generated by ApiGen