# TimeIntervalsGenerator Class Reference
[Dynamic query builder]

Inheritance diagram for TimeIntervalsGenerator:
[legend]

List of all members.

## Public Member Functions

| setRange (DateRange $range)
| getRange ()
| setInterval (IntervalUnit $interval)
| setOverlapped ($overlapped=true)
| isOverlapped ()
| getField ()
| setField ($field)
| getInterval ()
| toSelectQuery ()
| toDialectString (Dialect $dialect)

## Static Public Member Functions

static | create ()

## Public Attributes

const | ITERATOR_ALIAS = 'iterator'

## Private Member Functions

| getSeriesGenerator ($start, $stop, $step=null)

## Private Attributes

| $range = null
| $interval = null
| $overlapped = true
| $field = 'time'

## Detailed Description

Definition at line 15 of file TimeIntervalsGenerator.class.php.

## Member Function Documentation

static TimeIntervalsGenerator::create | ( |  | ) | `[static]`

Definition at line 26 of file TimeIntervalsGenerator.class.php.

Referenced by getSeriesGenerator(), and toSelectQuery().

TimeIntervalsGenerator::getField | ( |  | ) |

Definition at line 67 of file TimeIntervalsGenerator.class.php.

TimeIntervalsGenerator::getInterval | ( |  | ) |

Returns:
  IntervalUnit

Definition at line 82 of file TimeIntervalsGenerator.class.php.

TimeIntervalsGenerator::getRange | ( |  | ) |

Returns:
  DateRange

Definition at line 41 of file TimeIntervalsGenerator.class.php.

TimeIntervalsGenerator::getSeriesGenerator | ( | $ | start,
|  | $ | stop,
|  | $ | step = `null` |
| ) |  |  | `[private]`

Returns:
  DialectString

FIXME: DBI-result, method works only for PostgreSQL. Research how to generate series of values in MySQL and implement this.

Definition at line 149 of file TimeIntervalsGenerator.class.php.

References DataType::create(), DBValue::create(), create(), and DataType::INTEGER.

Referenced by toSelectQuery().

Here is the call graph for this function:

TimeIntervalsGenerator::isOverlapped | ( |  | ) |

Definition at line 62 of file TimeIntervalsGenerator.class.php.

TimeIntervalsGenerator::setField | ( | $ | field | ) |

Definition at line 72 of file TimeIntervalsGenerator.class.php.

References $field.

TimeIntervalsGenerator::setInterval | ( | IntervalUnit $ | interval | ) |

Definition at line 46 of file TimeIntervalsGenerator.class.php.

TimeIntervalsGenerator::setOverlapped | ( | $ | overlapped = `true` | ) |

Definition at line 53 of file TimeIntervalsGenerator.class.php.

References $overlapped, and Assert::isBoolean().

Here is the call graph for this function:

TimeIntervalsGenerator::setRange | ( | DateRange $ | range | ) |

Definition at line 31 of file TimeIntervalsGenerator.class.php.

TimeIntervalsGenerator::toDialectString | ( | Dialect $ | dialect | ) |

Definition at line 137 of file TimeIntervalsGenerator.class.php.

References toSelectQuery().

Here is the call graph for this function:

TimeIntervalsGenerator::toSelectQuery | ( |  | ) |

Definition at line 87 of file TimeIntervalsGenerator.class.php.

References Expression::add(), create(), DataType::create(), DBValue::create(), getSeriesGenerator(), DataType::INTERVAL, Expression::mul(), OSQL::select(), and DataType::TIMESTAMP.

Referenced by toDialectString().

Here is the call graph for this function:

## Member Data Documentation

TimeIntervalsGenerator::$field = 'time'`[private]`

Definition at line 24 of file TimeIntervalsGenerator.class.php.

Referenced by setField().

TimeIntervalsGenerator::$interval = null`[private]`

Definition at line 20 of file TimeIntervalsGenerator.class.php.

TimeIntervalsGenerator::$overlapped = true`[private]`

Definition at line 22 of file TimeIntervalsGenerator.class.php.

Referenced by setOverlapped().

TimeIntervalsGenerator::$range = null`[private]`

Definition at line 19 of file TimeIntervalsGenerator.class.php.

const TimeIntervalsGenerator::ITERATOR_ALIAS = 'iterator'

Definition at line 17 of file TimeIntervalsGenerator.class.php.

The documentation for this class was generated from the following file:

- core/OSQL/TimeIntervalsGenerator.class.php