PHP Class FOF30\Model\DataModel\Filter\AbstractFilter

Afficher le fichier Open project: akeeba/fof Class Usage Examples

Méthodes publiques

Свойство Type Description
$null_value mixed The null value for this type

Protected Properties

Свойство Type Description
$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

Méthodes publiques

Méthode Description
__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

Method Details

__construct() public méthode

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

between() abstract public méthode

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?
Résultat string The SQL where clause for this search

exact() public méthode

Perform an exact match (equality matching)
public exact ( mixed $value ) : string
$value mixed The value to compare to
Résultat string The SQL where clause for this search

getDefaultSearchMethod() public méthode

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().
See also: self::getSearchMethods()
public getDefaultSearchMethod ( ) : string
Résultat string

getField() public static méthode

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)
Résultat AbstractFilter The Filter object

getFieldName() public méthode

Get the field name
public getFieldName ( ) : string
Résultat string The field name

getFieldType() public static méthode

Get the class name based on the field Type
public static getFieldType ( string $type ) : string
$type string The type of the field
Résultat string the class name suffix

getSearchMethods() public méthode

Return the search methods available for this field class,
public getSearchMethods ( ) : array
Résultat array

interval() abstract public méthode

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
Résultat string The SQL where clause for this search

isEmpty() public méthode

Is it a null or otherwise empty value?
public isEmpty ( mixed $value ) : boolean
$value mixed The value to test for emptiness
Résultat boolean

modulo() abstract public méthode

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?
Résultat string The SQL where clause

outside() abstract public méthode

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?
Résultat string The SQL where clause for this search

partial() abstract public méthode

Perform a partial match (usually: search in string)
abstract public partial ( mixed $value ) : string
$value mixed The value to compare to
Résultat string The SQL where clause for this search

range() abstract public méthode

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?
Résultat string The SQL where clause for this search

Property Details

$db protected_oe property

protected $db

$filterZero protected_oe property

Should I allow filtering against the number 0?
protected bool $filterZero
Résultat boolean

$name protected_oe property

The column name of the table field
protected string $name
Résultat string

$null_value public_oe property

The null value for this type
public mixed $null_value
Résultat mixed

$tableAlias protected_oe property

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
Résultat null

$type protected_oe property

The column type of the table field
protected string $type
Résultat string