mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Reorder and categorize query attributes for easy reference
This commit is contained in:
parent
a1b946bae6
commit
dcbd26e7f2
2 changed files with 19 additions and 8 deletions
|
|
@ -7,14 +7,11 @@ namespace Rhymix\Framework\Parsers\DBQuery;
|
|||
*/
|
||||
class Query extends VariableBase
|
||||
{
|
||||
/**
|
||||
* Attributes common to all queries.
|
||||
*/
|
||||
public $name;
|
||||
public $alias;
|
||||
public $type;
|
||||
public $operation;
|
||||
public $column;
|
||||
public $pipe;
|
||||
public $join_type;
|
||||
public $join_conditions = array();
|
||||
public $tables = array();
|
||||
public $columns = array();
|
||||
public $conditions = array();
|
||||
|
|
@ -24,7 +21,21 @@ class Query extends VariableBase
|
|||
public $update_duplicate = false;
|
||||
|
||||
/**
|
||||
* Attributes for query generation.
|
||||
* Attributes for subqueries in the <tables> or <columns> section.
|
||||
*/
|
||||
public $alias;
|
||||
public $join_type;
|
||||
public $join_conditions = array();
|
||||
|
||||
/**
|
||||
* Attributes for subqueries in the <conditions> section.
|
||||
*/
|
||||
public $operation;
|
||||
public $column;
|
||||
public $pipe;
|
||||
|
||||
/**
|
||||
* Attributes used during query string generation.
|
||||
*/
|
||||
protected $_prefix = '';
|
||||
protected $_args = array();
|
||||
|
|
|
|||
|
|
@ -40,12 +40,12 @@ class DBQueryParser
|
|||
// Load basic information about this query.
|
||||
$query = new DBQuery\Query;
|
||||
$query->name = $name ?: null;
|
||||
$query->type = strtoupper($xml['action']) ?: 'SELECT';
|
||||
$query->alias = trim($xml['alias']) ?: null;
|
||||
if ($query->alias && !$query->name)
|
||||
{
|
||||
$query->name = $query->alias;
|
||||
}
|
||||
$query->type = strtoupper($xml['action']) ?: 'SELECT';
|
||||
|
||||
// Load attributes that only apply to subqueries in the <conditions> block.
|
||||
$query->operation = trim($xml['operation']) ?: null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue