Query\Query_Builder_Interface
Interface defining the Query Builder class
Synopsis
interface Query_Builder_Interface
{
- // methods
- public Query_Builder select()
- public Query_Builder select_max()
- public Query_Builder select_min()
- public Query_Builder select_avg()
- public Query_Builder select_sum()
- public Query_Builder distinct()
- public Query_Builder explain()
- public Query_Builder from()
- public Query_Builder like()
- public Query_Builder or_like()
- public Query_Builder not_like()
- public Query_Builder or_not_like()
- public Query_Builder having()
- public Query_Builder or_having()
- public Query_Builder where()
- public Query_Builder or_where()
- public Query_Builder where_in()
- public Query_Builder or_where_in()
- public Query_Builder where_not_in()
- public Query_Builder or_where_not_in()
- public Query_Builder set()
- public Query_Builder join()
- public Query_Builder group_by()
- public Query_Builder order_by()
- public Query_Builder limit()
- public Query_Builder group_start()
- public Query_Builder or_group_start()
- public Query_Builder or_not_group_start()
- public Query_Builder group_end()
- public PDOStatement get()
- public PDOStatement get_where()
- public int count_all()
- public int count_all_results()
- public PDOStatement insert()
- public PDOStatement|null insert_batch()
- public PDOStatement update()
- public PDOStatement delete()
- public string get_compiled_select()
- public string get_compiled_insert()
- public string get_compiled_update()
- public string get_compiled_delete()
- public void reset_query()
Methods
public
- count_all() — Retrieve the number of rows in the selected table
- count_all_results() — Retrieve the number of results for the generated query - used in place of the get() method
- delete() — Deletes data from a table
- distinct() — Adds the 'distinct' keyword to a query
- explain() — Shows the query plan for the query
- from() — Specify the database table to select from
- get() — Select and retrieve all records from the current table, and/or execute current compiled query
- get_compiled_delete() — Returns the generated 'delete' sql query
- get_compiled_insert() — Returns the generated 'insert' sql query
- get_compiled_select() — Returns the generated 'select' sql query
- get_compiled_update() — Returns the generated 'update' sql query
- get_where() — Convience method for get() with a where clause
- group_by() — Group the results by the selected field(s)
- group_end() — Ends a query group
- group_start() — Adds a paren to the current query for query grouping
- having() — Generates a 'Having' clause
- insert() — Creates an insert clause, and executes it
- insert_batch() — Creates and executes a batch insertion query
- join() — Creates a join phrase in a compiled query
- like() — Creates a Like clause in the sql statement
- limit() — Set a limit on the current sql statement
- not_like() — Generates a NOT LIKE clause
- or_group_start() — Adds a paren to the current query for query grouping, prefixed with 'OR'
- or_having() — Generates a 'Having' clause prefixed with 'OR'
- or_like() — Generates an OR Like clause
- or_not_group_start() — Adds a paren to the current query for query grouping, prefixed with 'OR NOT'
- or_not_like() — Generates a OR NOT LIKE clause
- or_where() — Where clause prefixed with "OR"
- or_where_in() — Where in statement prefixed with "or"
- or_where_not_in() — OR WHERE NOT IN (FOO) clause
- order_by() — Order the results by the selected field(s)
- reset_query() — Clear out the class variables, so the next query can be run
- select() — Specifies rows to select in a query
- select_avg() — Selects the average value of a field from a query
- select_max() — Selects the maximum value of a field from a query
- select_min() — Selects the minimum value of a field from a query
- select_sum() — Selects the sum of a field from a query
- set() — Sets values for inserts / updates / deletes
- update() — Creates an update clause, and executes it
- where() — Specify condition(s) in the where clause of a query Note: this function works with key / value, or a passed array with key / value pairs
- where_in() — Where clause with 'IN' statement
- where_not_in() — WHERE NOT IN (FOO) clause