# SelectQuery Class Reference
[Dynamic query builder]

Inheritance diagram for SelectQuery:
[legend]

List of all members.

## Public Member Functions

| __construct ()
| __clone ()
| hasAliasInside ($alias)
| getAlias ()
| getName ()
| setName ($name)
| distinct ()
| isDistinct ()
| unDistinct ()
| hasJoinedTable ($table)
| join ($table, LogicalObject $logic, $alias=null)
| leftJoin ($table, LogicalObject $logic, $alias=null)
| rightJoin ($table, LogicalObject $logic, $alias=null)
| setOrderChain (OrderChain $chain)
| orderBy ($field, $table=null)
| prependOrderBy ($field, $table=null)
| desc ()
| asc ()
| groupBy ($field, $table=null)
| dropGroupBy ()
| having (LogicalObject $exp)
| getLimit ()
| getOffset ()
| limit ($limit=null, $offset=null)
| from ($table, $alias=null)
| getFirstTable ()
| get ($field, $alias=null)
| multiGet ()
| arrayGet ($array, $prefix=null)
| getFieldsCount ()
| getTablesCount ()
| getFieldNames ()
| returning ($field, $alias=null)
| toDialectString (Dialect $dialect)
| dropFields ()
| dropOrder ()
| dropLimit ()

## Private Member Functions

| getLastTable ($table=null)
| makeOrder ($field, $table=null)

## Private Attributes

| $distinct = false
| $name = null
| $joiner = null
| $limit = null
| $offset = null
| $fields = array()
| $order = null
| $group = array()
| $having = null

## Detailed Description

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

## Constructor & Destructor Documentation

SelectQuery::__construct | ( |  | ) |

Definition at line 36 of file SelectQuery.class.php.

## Member Function Documentation

SelectQuery::__clone | ( |  | ) |

Definition at line 42 of file SelectQuery.class.php.

SelectQuery::arrayGet | ( | $ | array,
|  | $ | prefix = `null` |
| ) |  |  |

Returns:
  SelectQuery

Definition at line 308 of file SelectQuery.class.php.

References getAlias().

Here is the call graph for this function:

SelectQuery::asc | ( |  | ) |

Exceptions:

  | WrongStateException |

Returns:
  SelectQuery

Definition at line 183 of file SelectQuery.class.php.

SelectQuery::desc | ( |  | ) |

Exceptions:

  | WrongStateException |

Returns:
  SelectQuery

Definition at line 169 of file SelectQuery.class.php.

SelectQuery::distinct | ( |  | ) |

Returns:
  SelectQuery

Definition at line 77 of file SelectQuery.class.php.

Referenced by Criteria::fillSelectQuery(), and unDistinct().

SelectQuery::dropFields | ( |  | ) |

Returns:
  SelectQuery

Definition at line 419 of file SelectQuery.class.php.

SelectQuery::dropGroupBy | ( |  | ) |

Returns:
  SelectQuery

Definition at line 210 of file SelectQuery.class.php.

SelectQuery::dropLimit | ( |  | ) |

Returns:
  SelectQuery

Definition at line 437 of file SelectQuery.class.php.

References limit().

Here is the call graph for this function:

SelectQuery::dropOrder | ( |  | ) |

Returns:
  SelectQuery

Definition at line 428 of file SelectQuery.class.php.

SelectQuery::from | ( | $ | table,
|  | $ | alias = `null` |
| ) |  |  |

Returns:
  SelectQuery

Definition at line 257 of file SelectQuery.class.php.

SelectQuery::get | ( | $ | field,
|  | $ | alias = `null` |
| ) |  |  |

Exceptions:

  | WrongArgumentException |

Returns:
  SelectQuery

Definition at line 275 of file SelectQuery.class.php.

References getLastTable(), QuerySkeleton::resolveAliasByField(), and QuerySkeleton::resolveSelectField().

Referenced by Criteria::joinProperties().

Here is the call graph for this function:

SelectQuery::getAlias | ( |  | ) |

Implements Aliased.

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

Referenced by arrayGet().

SelectQuery::getFieldNames | ( |  | ) |

Definition at line 353 of file SelectQuery.class.php.

SelectQuery::getFieldsCount | ( |  | ) |

Definition at line 343 of file SelectQuery.class.php.

Referenced by CommonDaoWorker::getCustomRowList().

SelectQuery::getFirstTable | ( |  | ) |

Definition at line 266 of file SelectQuery.class.php.

SelectQuery::getLastTable | ( | $ | table = `null` | ) | `[private]`

Definition at line 443 of file SelectQuery.class.php.

Referenced by get(), groupBy(), and makeOrder().

SelectQuery::getLimit | ( |  | ) |

Definition at line 226 of file SelectQuery.class.php.

Referenced by CommonDaoWorker::getCustom().

SelectQuery::getName | ( |  | ) |

Definition at line 58 of file SelectQuery.class.php.

SelectQuery::getOffset | ( |  | ) |

Definition at line 231 of file SelectQuery.class.php.

SelectQuery::getTablesCount | ( |  | ) |

Definition at line 348 of file SelectQuery.class.php.

SelectQuery::groupBy | ( | $ | field,
|  | $ | table = `null` |
| ) |  |  |

Returns:
  SelectQuery

Definition at line 196 of file SelectQuery.class.php.

References getLastTable().

Here is the call graph for this function:

SelectQuery::hasAliasInside | ( | $ | alias | ) |

Definition at line 48 of file SelectQuery.class.php.

SelectQuery::hasJoinedTable | ( | $ | table | ) |

Definition at line 97 of file SelectQuery.class.php.

Referenced by ManyToManyLinkedWorker::joinHelperTable(), and Criteria::joinProperties().

SelectQuery::having | ( | LogicalObject $ | exp | ) |

Returns:
  SelectQuery

Definition at line 219 of file SelectQuery.class.php.

Referenced by toDialectString().

SelectQuery::isDistinct | ( |  | ) |

Definition at line 83 of file SelectQuery.class.php.

SelectQuery::join | ( | $ | table,
|  | LogicalObject $ | logic,
|  | $ | alias = `null` |
| ) |  |  |

Returns:
  SelectQuery

Definition at line 105 of file SelectQuery.class.php.

Referenced by Criteria::joinProperties().

SelectQuery::leftJoin | ( | $ | table,
|  | LogicalObject $ | logic,
|  | $ | alias = `null` |
| ) |  |  |

Returns:
  SelectQuery

Definition at line 116 of file SelectQuery.class.php.

Referenced by Criteria::joinProperties().

SelectQuery::limit | ( | $ | limit = `null`,
|  | $ | offset = `null` |
| ) |  |  |

Exceptions:

  | WrongArgumentException |

Returns:
  SelectQuery

Definition at line 240 of file SelectQuery.class.php.

References $limit, $offset, Assert::isInteger(), and Assert::isPositiveInteger().

Referenced by dropLimit(), and toDialectString().

Here is the call graph for this function:

SelectQuery::makeOrder | ( | $ | field,
|  | $ | table = `null` |
| ) |  |  | `[private]`

Returns:
  OrderBy

Definition at line 454 of file SelectQuery.class.php.

References getLastTable().

Referenced by orderBy(), and prependOrderBy().

Here is the call graph for this function:

SelectQuery::multiGet | ( |  | ) |

Returns:
  SelectQuery

Definition at line 294 of file SelectQuery.class.php.

References $args.

SelectQuery::orderBy | ( | $ | field,
|  | $ | table = `null` |
| ) |  |  |

Returns:
  SelectQuery

Definition at line 148 of file SelectQuery.class.php.

References makeOrder().

Here is the call graph for this function:

SelectQuery::prependOrderBy | ( | $ | field,
|  | $ | table = `null` |
| ) |  |  |

Returns:
  SelectQuery

Definition at line 158 of file SelectQuery.class.php.

References makeOrder().

Here is the call graph for this function:

SelectQuery::returning | ( | $ | field,
|  | $ | alias = `null` |
| ) |  |  |

Definition at line 370 of file SelectQuery.class.php.

SelectQuery::rightJoin | ( | $ | table,
|  | LogicalObject $ | logic,
|  | $ | alias = `null` |
| ) |  |  |

Returns:
  SelectQuery

Definition at line 127 of file SelectQuery.class.php.

SelectQuery::setName | ( | $ | name | ) |

Returns:
  SelectQuery

Definition at line 66 of file SelectQuery.class.php.

References $name.

SelectQuery::setOrderChain | ( | OrderChain $ | chain | ) |

Returns:
  SelectQuery

Definition at line 138 of file SelectQuery.class.php.

Referenced by Criteria::fillSelectQuery().

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

Definition at line 375 of file SelectQuery.class.php.

References $group, having(), limit(), and QuerySkeleton::toDialectStringField().

Referenced by CommonDaoWorker::getCustom(), CommonDaoWorker::getCustomList(), CommonDaoWorker::getCustomRowList(), and CommonDaoWorker::getListByQuery().

Here is the call graph for this function:

SelectQuery::unDistinct | ( |  | ) |

Returns:
  SelectQuery

Definition at line 91 of file SelectQuery.class.php.

References distinct().

Here is the call graph for this function:

## Member Data Documentation

SelectQuery::$distinct = false`[private]`

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

SelectQuery::$fields = array()`[private]`

Definition at line 28 of file SelectQuery.class.php.

SelectQuery::$group = array()`[private]`

Definition at line 32 of file SelectQuery.class.php.

Referenced by toDialectString().

SelectQuery::$having = null`[private]`

Definition at line 34 of file SelectQuery.class.php.

SelectQuery::$joiner = null`[private]`

Definition at line 23 of file SelectQuery.class.php.

SelectQuery::$limit = null`[private]`

Definition at line 25 of file SelectQuery.class.php.

Referenced by limit().

SelectQuery::$name = null`[private]`

Definition at line 21 of file SelectQuery.class.php.

Referenced by setName().

SelectQuery::$offset = null`[private]`

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

Referenced by limit().

SelectQuery::$order = null`[private]`

Definition at line 30 of file SelectQuery.class.php.

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

- core/OSQL/SelectQuery.class.php