Query\AbstractQueryBuilder
Abstract Class for internal implementation methods of the Query Builder
Synopsis
- // constants
- const KEY = 0;
- const VALUE = 1;
- const BOTH = 2;
- // members
- protected string $select_string = '';
- protected $from_string;
- protected $set_string;
- protected $order_string;
- protected $group_string;
- protected array $set_array_keys = ;
- protected array $order_array = ;
- protected array $group_array = ;
- protected array $values = ;
- protected array $where_values = ;
- protected $limit;
- protected $offset;
- protected array $query_map = ;
- protected $having_map;
- public string $conn_name = "";
- public $queries;
- protected bool $explain;
- public Driver_Interface $db;
- public Query_Parser $parser;
- public Abstract_Util $util;
- public SQL_Interface $sql;
- // methods
- protected array _mixed_set()
- protected string _select()
- protected string _get_compile()
- protected Query_Builder _like()
- protected Query_Builder _having()
- protected array _where()
- protected Query_Builder _where_string()
- protected Query_Builder _where_in()
- protected PDOStatement _run()
- protected void _append_map()
- protected void _append_query()
- protected string _compile_type()
- protected string _compile()
Constants
Name | Value |
---|---|
KEY | 0 |
VALUE | 1 |
BOTH | 2 |
Members
protected
- $explain
—
Query\bool
Whether to do only an explain on the query - $from_string
—
string
Compiled 'from' clause - $group_array
—
array
Key/val pairs for group by clause - $group_string
—
string
Group by clause - $having_map
—
array
Map for having clause - $limit
—
string
Value for limit string - $offset
—
int
Value for offset in limit string - $order_array
—
array
Key/val pairs for order by clause - $order_string
—
string
Order by clause - $query_map
—
array
Query component order mapping for complex select queries - $select_string
—
string
Compiled 'select' clause - $set_array_keys
—
array
Keys for insert/update statement - $set_string
—
string
Compiled arguments for insert / update - $values
—
array
Values to apply to prepared statements - $where_values
—
array
Values to apply to where clauses in prepared statements
public
- $conn_name
—
string
Convenience property for connection management - $db
—
Query\Driver_Interface
The current database driver - $parser
—
Query\Query_Parser
Query parser class instance - $queries
—
array
List of queries executed - $sql
—
\Query\Driver\SQL_Interface
Alias to driver sql class - $util
—
\Query\Driver\Abstract_Util
Alias to driver util class
Methods
protected
- _append_map() — Add an additional set of mapping pairs to a internal map
- _append_query() — Convert the prepared statement into readable sql
- _compile() — String together the sql statements for sending to the db
- _compile_type() — Sub-method for generating sql strings
- _get_compile() — Helper function for returning sql strings
- _having() — Simplify building having clauses
- _like() — Simplify 'like' methods
- _mixed_set() — Set values in the class, with either an array or key value pair
- _run() — Executes the compiled query
- _select() — Method to simplify select_ methods
- _where() — Do all the repeditive stuff for where/having type methods
- _where_in() — Simplify where_in methods
- _where_string() — Simplify generating where string
History
-
2015-11-10T10:12:23-05:00 (commit #b5a141f)
Author: Timothy J Warren (tim@timshomepage.net) / Commiter: Timothy J Warren (tim@timshomepage.net)
Make class names Pascal Case
-
2015-11-10T09:24:18-05:00 (commit #39cd2ec)
Author: Timothy J Warren (tim@timshomepage.net) / Commiter: Timothy J Warren (tim@timshomepage.net)
Fix borkeed tests
-
2015-07-31T10:24:34-04:00 (commit #056e8bf)
Author: Timothy J. Warren (tim@timshomepage.net) / Commiter: Timothy J. Warren (tim@timshomepage.net)
Re-add some missing tests, and update README
-
2015-07-30T16:40:30-04:00 (commit #225017a)
Author: Timothy J. Warren (tim@timshomepage.net) / Commiter: Timothy J. Warren (tim@timshomepage.net)
Lots of refactoring -- accessors/mutators instead of direct access, reduce query builder test database connections, and simplify some logic
-
2015-07-30T13:13:12-04:00 (commit #8669fcc)
Author: Timothy J. Warren (tim@timshomepage.net) / Commiter: Timothy J. Warren (tim@timshomepage.net)
Some scrutinizer fixes
-
2015-07-29T16:51:17-04:00 (commit #8511c6a)
Author: Timothy J. Warren (tim@timshomepage.net) / Commiter: Timothy J. Warren (tim@timshomepage.net)
Move library into src folder, fix simpletest test runner
-
2015-07-16T16:56:13-04:00 (commit #bfc3ea3)
Author: Timothy J. Warren (tim@timshomepage.net) / Commiter: Timothy J. Warren (tim@timshomepage.net)
Reorganize drivers into a more modern layout
-
2014-11-07T12:21:49-05:00 (commit #6c757f1)
Author: Timothy J. Warren (tim@timshomepage.net) / Commiter: Timothy J. Warren (tim@timshomepage.net)
Update docs
-
2014-11-07T12:14:46-05:00 (commit #6755818)
Author: Timothy J. Warren (tim@timshomepage.net) / Commiter: Timothy J. Warren (tim@timshomepage.net)
Fix some issues with multiple array items in where statements
-
2014-08-08T13:48:20-04:00 (commit #dd672df)
Author: Timothy J. Warren (tim@timshomepage.net) / Commiter: Timothy J. Warren (tim@timshomepage.net)
Reorganize classes to autoload by namespace
-
2014-07-15T11:01:47-04:00 (commit #2ae2064)
Author: Timothy J. Warren (tim@timshomepage.net) / Commiter: Timothy J. Warren (tim@timshomepage.net)
Fix some very minor code quality issues
-
2014-06-30T11:14:37-04:00 (commit #618a561)
Author: Timothy J. Warren (tim@timshomepage.net) / Commiter: Timothy J. Warren (tim@timshomepage.net)
Fix minor issue of where clause disappearing after a number of joins
-
2014-06-09T17:02:14-04:00 (commit #1abd835)
Author: Timothy J. Warren (tim@timshomepage.net) / Commiter: Timothy J. Warren (tim@timshomepage.net)
Attempting some Quercus compatibility, test-suite runs with simpletest as well as PHPUnit
-
2014-04-28T16:41:46-04:00 (commit #6a38213)
Author: Timothy J. Warren (tim@timshomepage.net) / Commiter: Timothy J. Warren (tim@timshomepage.net)
Improve some tests and docblocks
-
2014-04-24T21:29:40-04:00 (commit #315dc5e)
Author: Timothy J. Warren (tim@timshomepage.net) / Commiter: Timothy J. Warren (tim@timshomepage.net)
method shortening
-
2014-04-24T20:14:19-04:00 (commit #2ae38be)
Author: Timothy J. Warren (tim@timshomepage.net) / Commiter: Timothy J. Warren (tim@timshomepage.net)
Remove some variable setting logic duplication