public
|
#
__construct( FOFDatabaseDriver $db, object $field, string $table_alias = false )
Constructor
Parameters
- $db
FOFDatabaseDriver - $db The database object
- $field
object - $field The field informations as taken from the db
- $table_alias
string - $table_alias The table alias to use when filtering
|
public
boolean
|
#
isEmpty( mixed $value )
Is it a null or otherwise empty value?
Is it a null or otherwise empty value?
Parameters
- $value
mixed - $value The value to test for emptiness
Returns
boolean
|
public
string
|
#
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().
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().
Returns
string
See
|
public
array
|
#
getSearchMethods( )
Return the search methods available for this field class,
Return the search methods available for this field class,
Returns
array
|
public
string
|
#
exact( mixed $value )
Perform an exact match (equality matching)
Perform an exact match (equality matching)
Parameters
- $value
mixed - $value The value to compare to
Returns
string - The SQL where clause for this search
|
abstract public
string
|
#
partial( mixed $value )
Perform a partial match (usually: search in string)
Perform a partial match (usually: search in string)
Parameters
- $value
mixed - $value The value to compare to
Returns
string - The SQL where clause for this search
|
abstract public
string
|
#
between( mixed $from, mixed $to, boolean $include = true )
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
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
Parameters
- $from
mixed - $from The lowest value to compare to
- $to
mixed - $to The higherst value to compare to
- $include
boolean - $include Should we include the boundaries in the search?
Returns
string - The SQL where clause for this search
|
abstract public
string
|
#
outside( mixed $from, mixed $to, boolean $include = false )
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)
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)
Parameters
- $from
mixed - $from The lowest value of the excluded range
- $to
mixed - $to The higherst value of the excluded range
- $include
boolean - $include Should we include the boundaries in the search?
Returns
string - The SQL where clause for this search
|
abstract public
string
|
#
interval( string $from, string|array|object $interval )
Perform an interval search (usually: a date interval check)
Perform an interval search (usually: a date interval check)
Parameters
- $from
string - $from The value to search
- $interval
string|array|object - $interval The interval
Returns
string - The SQL where clause for this search
|
abstract public
string
|
#
range( mixed $from, mixed $to, boolean $include = true )
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
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
Parameters
- $from
mixed - $from The lowest value to compare to
- $to
mixed - $to The higherst value to compare to
- $include
boolean - $include Should we include the boundaries in the search?
Returns
string - The SQL where clause for this search
|
abstract public
string
|
#
modulo( integer|float $from, integer|float $interval, boolean $include = true )
Perform an modulo search
Parameters
- $from
integer|float - $value The starting value of the search space
- $interval
integer|float - $interval The interval period of the search space
- $include
boolean - $include Should I include the boundaries in the search?
Returns
string - The SQL where clause
|
public
string
|
#
search( mixed $value, string $operator = '=' )
Return the SQL where clause for a search
Return the SQL where clause for a search
Parameters
- $value
mixed - $value The value to search for
- $operator
string - $operator The operator to use
Returns
string - The SQL where clause for this search
|
public
string
|
#
getFieldName( )
Get the field name with the given table alias
Get the field name with the given table alias
Returns
string - The field name
|
public static
FOFModelField
|
#
getField( object $field, array $config = array() )
Creates a field Object based on the field column type
Creates a field Object based on the field column type
Parameters
- $field
object - $field The field informations
- $config
array - $config The field configuration (like the db object to use)
Returns
|
public static
string
|
#
getFieldType( string $type )
Get the classname based on the field Type
Get the classname based on the field Type
Parameters
- $type
string - $type The type of the field
Returns
string - the class suffix
|