PHP Class FOF30\Model\DataModel\Filter\Date

Inheritance: extends Text
Mostra file Open project: akeeba/fof Class Usage Examples

Public Methods

Method Description
between ( mixed $from, mixed $to, boolean $include = true ) : string Perform a between limits match. When $include is true the condition tested is: $from <= VALUE <= $to When $include is false the condition tested is: $from < VALUE < $to
getDefaultSearchMethod ( ) : string Returns the default search method for this field.
interval ( string $value, string | array | object $interval, boolean $include = true ) : string Interval date search
outside ( mixed $from, mixed $to, boolean $include = false ) : string Perform an outside limits match. When $include is true the condition tested is: (VALUE <= $from) || (VALUE >= $to) When $include is false the condition tested is: (VALUE < $from) || (VALUE > $to)
range ( mixed $from, mixed $to, boolean $include = true ) : string Perform a between limits match. When $include is true the condition tested is: $from <= VALUE <= $to When $include is false the condition tested is: $from < VALUE < $to

Protected Methods

Method Description
getInterval ( string | array | object $interval ) : array Parses an interval –which may be given as a string, array or object– into a standardised hash array that can then be used bu the interval() method.

Method Details

between() public method

Perform a between limits match. When $include is true the condition tested is: $from <= VALUE <= $to When $include is false the condition tested is: $from < VALUE < $to
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?
return string The SQL where clause for this search

getDefaultSearchMethod() public method

Returns the default search method for this field.
public getDefaultSearchMethod ( ) : string
return string

getInterval() protected method

Parses an interval –which may be given as a string, array or object– into a standardised hash array that can then be used bu the interval() method.
protected getInterval ( string | array | object $interval ) : array
$interval string | array | object The interval expression to parse
return array The parsed, hash array form of the interval

interval() public method

Interval date search
public interval ( string $value, string | array | object $interval, boolean $include = true ) : string
$value string The value to search
$interval string | array | object The interval. Can be (+1 MONTH or array('value' => 1, 'unit' => 'MONTH', 'sign' => '+'))
$include boolean If the borders should be included
return string the sql string

outside() public method

Perform an outside limits match. When $include is true the condition tested is: (VALUE <= $from) || (VALUE >= $to) When $include is false the condition tested is: (VALUE < $from) || (VALUE > $to)
public outside ( mixed $from, mixed $to, boolean $include = false ) : string
$from mixed The lowest value of the excluded range
$to mixed The higherst value of the excluded range
$include boolean Should we include the boundaries in the search?
return string The SQL where clause for this search

range() public method

Perform a between limits match. When $include is true the condition tested is: $from <= VALUE <= $to When $include is false the condition tested is: $from < VALUE < $to
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?
return string The SQL where clause for this search