Class: Query
Source Location: /myphp-1.9/myphp-1.9-db/html/query/Query.php
Class Query
Class Overview
|
The Query object, which will supply all the sql
- Usage:
- $query = new Query();
- print $query->get($table,$id,$sid,$translate,$orderby,$sorted='',
- $skip='',$show='',$groupby='',$having='');
- Or
- $query = Query::get($table,$id,$sid,$translate,$orderby,$sorted='',
- $skip='',$show='',$groupby='',$having='');
- Or
- $text = Query::translate($sql);
Located in /myphp-1.9/myphp-1.9-db/html/query/Query.php [line 34]
|
Methods
|
Direct descendents
| QueryBasket |
The Query object, which will supply all the sql for the Basket
|
| QueryCustomer |
The Query object, which will supply all the sql for the Customer
|
| QueryFormmail |
The Query object, which will supply all the sql for the Form Mail
|
| QueryHistory |
The Query object, which will supply all the sql for the History
|
| QueryLogin |
The Query object, which will supply all the sql for the Login
|
Method Summary
| Query |
Query() |
Constructor |
| String |
from() |
Return the FROM part of the query |
| String |
get() |
Return the query specified |
| String |
groupby() |
Return the GROUP BY part of the query |
| String |
having() |
Return the HAVING part of the query |
| String |
limit() |
Return the LIMIT [$skip,] $show The Limit part of the query |
| String |
orderby() |
Return the ORDER BY part of the query |
| String |
select() |
Return the SELECT part of the query |
| String |
translate() |
Return the translated SQL to language specific |
| String |
where() |
Return the WHERE part of the query |
Methods
String from(
String
$table
)
|
|
Return the FROM part of the query
Parameters:
|
String |
$table: |
The table to use |
API Tags:
| Return: | The requested query |
| Static: | |
String get(
String
$table, [String
$id = ''], [String
$sid = ''], [boolean
$translate = true], [String
$orderby = ''], [String
$sorted = ''], [String
$skip = ''], [String
$show = ''], [String
$groupby = ''], [String
$having = '']
)
|
|
Return the query specified
Parameters:
|
String |
$table: |
The table to use |
|
String |
$id: |
The primary key to use |
|
String |
$sid: |
The foreign key to use |
|
boolean |
$translate: |
The query is translated to language (true) |
|
String |
$orderby: |
The Order By to use |
|
String |
$sorted: |
The sorted asc/desc (together with order by) |
|
String |
$skip: |
The skip number of lines |
|
String |
$show: |
The number to show |
|
String |
$groupby: |
The group by |
|
String |
$having: |
The having (together with group by) |
API Tags:
| Return: | The requested query |
| Static: | |
Redefined in descendants as:
String groupby(
[String
$groupby = '']
)
|
|
Return the GROUP BY part of the query
Parameters:
|
String |
$groupby: |
The Group By to use |
API Tags:
| Return: | The requested query |
| Static: | |
String having(
[String
$having = '']
)
|
|
Return the HAVING part of the query
Parameters:
|
String |
$having: |
The HAVING to use |
API Tags:
| Return: | The requested query |
| Static: | |
String limit(
[String
$skip = ''], [String
$show = '']
)
|
|
Return the LIMIT [$skip,] $show The Limit part of the query
Parameters:
|
String |
$skip: |
The skip number of lines |
|
String |
$show: |
The number of lines to show |
API Tags:
| Return: | The requested query |
| Static: | |
String orderby(
[String
$orderby = ''], [String
$sorted = SORT_BY_DEFAULT]
)
|
|
Return the ORDER BY part of the query
Parameters:
|
String |
$orderby: |
The Order By to use |
|
String |
$sorted: |
The sorted asc/desc |
API Tags:
| Return: | The requested query |
| Static: | |
String select(
String
$table, boolean
$translate
)
|
|
Return the SELECT part of the query
Parameters:
|
String |
$table: |
The table to use |
|
boolean |
$translate: |
The query is translated to language (true) |
API Tags:
| Return: | The requested query |
| Global: | DEFINE_QUERY_SELECT 0: The Select Table for a Query |
| Global: | TRANSLATE_QUERY 1: The name of the translation array |
| Static: | |
Redefined in descendants as:
String translate(
String
$key, [mixed
$name = '']
)
|
|
Return the translated SQL to language specific
Parameters:
|
String |
$key: |
The query key to translate |
API Tags:
| Return: | The translated query key |
| Static: | |
String where(
String
$table, [String
$id = ''], [String
$sid = '']
)
|
|
Return the WHERE part of the query
Parameters:
|
String |
$table: |
The table to use |
|
String |
$id: |
The primary key to use |
|
String |
$sid: |
The foriegn key to use |
API Tags:
| Return: | The requested query |
| Static: | |
|
|