PHP Класс FOF30\Model\DataModel\Filter\AbstractFilter

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$null_value mixed The null value for this type

Защищенные свойства (Protected)

Свойство Тип Описание
$db
$filterZero boolean Should I allow filtering against the number 0?
$name string The column name of the table field
$tableAlias null Prefix each table name with this table alias. For example, field bar normally creates a WHERE clause: bar = '1' If tableAlias is set to "foo" then the WHERE clause it generates becomes foo.bar = '1'
$type string The column type of the table field

Открытые методы

Метод Описание
__construct ( JDatabaseDriver $db, object $field ) Constructor
between ( mixed $from, mixed $to, boolean $include = true ) : string Perform a between limits match (usually: search for a value between two numbers or a date between two preset dates). When $include is true the condition tested is: $from <= VALUE <= $to When $include is false the condition tested is: $from < VALUE < $to
exact ( mixed $value ) : string Perform an exact match (equality matching)
getDefaultSearchMethod ( ) : string Returns the default search method for a field. This always returns 'exact' and you are supposed to override it in specialised classes. The possible values are exact, partial, between and outside, unless something different is returned by getSearchMethods().
getField ( object $field, array $config = [] ) : AbstractFilter Creates a field Object based on the field column type
getFieldName ( ) : string Get the field name
getFieldType ( string $type ) : string Get the class name based on the field Type
getSearchMethods ( ) : array Return the search methods available for this field class,
interval ( string $from, string | array | object $interval ) : string Perform an interval search (usually: a date interval check)
isEmpty ( mixed $value ) : boolean Is it a null or otherwise empty value?
modulo ( integer | float $from, integer | float $interval, boolean $include = true ) : string Perform an modulo search
outside ( mixed $from, mixed $to, boolean $include = false ) : string Perform an outside limits match (usually: search for a value outside an area or a date outside a preset period). When $include is true the condition tested is: (VALUE <= $from) || (VALUE >= $to) When $include is false the condition tested is: (VALUE < $from) || (VALUE > $to)
partial ( mixed $value ) : string Perform a partial match (usually: search in string)
range ( mixed $from, mixed $to, boolean $include = true ) : string Perform a between limits match (usually: search for a value between two numbers or a date between two preset dates). When $include is true the condition tested is: $from <= VALUE <= $to When $include is false the condition tested is: $from < VALUE < $to
search ( mixed $value, string $operator = '=' ) : string Return the SQL where clause for a search

Описание методов

__construct() публичный метод

Constructor
public __construct ( JDatabaseDriver $db, object $field )
$db JDatabaseDriver The database object
$field object The field information as taken from the db

between() абстрактный публичный метод

Perform a between limits match (usually: search for a value between two numbers or a date between two preset dates). When $include is true the condition tested is: $from <= VALUE <= $to When $include is false the condition tested is: $from < VALUE < $to
abstract public between ( mixed $from, mixed $to, boolean $include = true ) : string
$from mixed The lowest value to compare to
$to mixed The higherst value to compare to
$include boolean Should we include the boundaries in the search?
Результат string The SQL where clause for this search

exact() публичный метод

Perform an exact match (equality matching)
public exact ( mixed $value ) : string
$value mixed The value to compare to
Результат string The SQL where clause for this search

getDefaultSearchMethod() публичный метод

Returns the default search method for a field. This always returns 'exact' and you are supposed to override it in specialised classes. The possible values are exact, partial, between and outside, unless something different is returned by getSearchMethods().
См. также: self::getSearchMethods()
public getDefaultSearchMethod ( ) : string
Результат string

getField() публичный статический метод

Creates a field Object based on the field column type
public static getField ( object $field, array $config = [] ) : AbstractFilter
$field object The field informations
$config array The field configuration (like the db object to use)
Результат AbstractFilter The Filter object

getFieldName() публичный метод

Get the field name
public getFieldName ( ) : string
Результат string The field name

getFieldType() публичный статический метод

Get the class name based on the field Type
public static getFieldType ( string $type ) : string
$type string The type of the field
Результат string the class name suffix

getSearchMethods() публичный метод

Return the search methods available for this field class,
public getSearchMethods ( ) : array
Результат array

interval() абстрактный публичный метод

Perform an interval search (usually: a date interval check)
abstract public interval ( string $from, string | array | object $interval ) : string
$from string The value to search
$interval string | array | object The interval
Результат string The SQL where clause for this search

isEmpty() публичный метод

Is it a null or otherwise empty value?
public isEmpty ( mixed $value ) : boolean
$value mixed The value to test for emptiness
Результат boolean

modulo() абстрактный публичный метод

Perform an modulo search
abstract public modulo ( integer | float $from, integer | float $interval, boolean $include = true ) : string
$from integer | float The starting value of the search space
$interval integer | float The interval period of the search space
$include boolean Should I include the boundaries in the search?
Результат string The SQL where clause

outside() абстрактный публичный метод

Perform an outside limits match (usually: search for a value outside an area or a date outside a preset period). When $include is true the condition tested is: (VALUE <= $from) || (VALUE >= $to) When $include is false the condition tested is: (VALUE < $from) || (VALUE > $to)
abstract public outside ( mixed $from, mixed $to, boolean $include = false ) : string
$from mixed The lowest value of the excluded range
$to mixed The highest value of the excluded range
$include boolean Should we include the boundaries in the search?
Результат string The SQL where clause for this search

partial() абстрактный публичный метод

Perform a partial match (usually: search in string)
abstract public partial ( mixed $value ) : string
$value mixed The value to compare to
Результат string The SQL where clause for this search

range() абстрактный публичный метод

Perform a between limits match (usually: search for a value between two numbers or a date between two preset dates). When $include is true the condition tested is: $from <= VALUE <= $to When $include is false the condition tested is: $from < VALUE < $to
abstract public range ( mixed $from, mixed $to, boolean $include = true ) : string
$from mixed The lowest value to compare to
$to mixed The higherst value to compare to
$include boolean Should we include the boundaries in the search?
Результат string The SQL where clause for this search

Описание свойств

$db защищенное свойство

protected $db

$filterZero защищенное свойство

Should I allow filtering against the number 0?
protected bool $filterZero
Результат boolean

$name защищенное свойство

The column name of the table field
protected string $name
Результат string

$null_value публичное свойство

The null value for this type
public mixed $null_value
Результат mixed

$tableAlias защищенное свойство

Prefix each table name with this table alias. For example, field bar normally creates a WHERE clause: bar = '1' If tableAlias is set to "foo" then the WHERE clause it generates becomes foo.bar = '1'
protected null $tableAlias
Результат null

$type защищенное свойство

The column type of the table field
protected string $type
Результат string