mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-08 19:42:15 +09:00
add phpDoc comment
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10780 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
43999a0bb1
commit
ebc5edeec7
30 changed files with 830 additions and 161 deletions
|
|
@ -8,7 +8,7 @@
|
||||||
class ClickCountExpression extends SelectExpression {
|
class ClickCountExpression extends SelectExpression {
|
||||||
/**
|
/**
|
||||||
* click count
|
* click count
|
||||||
* @var boolean
|
* @var bool
|
||||||
*/
|
*/
|
||||||
var $click_count;
|
var $click_count;
|
||||||
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
* constructor
|
* constructor
|
||||||
* @param string $column_name
|
* @param string $column_name
|
||||||
* @param string $alias
|
* @param string $alias
|
||||||
* @param boolean $click_count
|
* @param bool $click_count
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function ClickCountExpression($column_name, $alias = NULL, $click_count = false){
|
function ClickCountExpression($column_name, $alias = NULL, $click_count = false){
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
* @author NHN (developers@xpressengine.com)
|
* @author NHN (developers@xpressengine.com)
|
||||||
* @package /classes/xml/xmlquery
|
* @package /classes/xml/xmlquery
|
||||||
* @version 0.1
|
* @version 0.1
|
||||||
**/
|
*/
|
||||||
class DBParser {
|
class DBParser {
|
||||||
/**
|
/**
|
||||||
* Character for escape target value on the left
|
* Character for escape target value on the left
|
||||||
|
|
@ -154,6 +154,11 @@
|
||||||
return implode('', $functions);
|
return implode('', $functions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Checks argument is asterisk
|
||||||
|
* @param string $column_name
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
function isStar($column_name){
|
function isStar($column_name){
|
||||||
if(substr($column_name,-1) == '*') return true;
|
if(substr($column_name,-1) == '*') return true;
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,34 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* QueryParser class
|
||||||
|
* @author NHN (developers@xpressengine.com)
|
||||||
|
* @package /classes/xml/xmlquery
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
class QueryParser {
|
class QueryParser {
|
||||||
|
/**
|
||||||
|
* QueryTag object
|
||||||
|
* @var QueryTag object
|
||||||
|
*/
|
||||||
var $queryTag;
|
var $queryTag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* constructor
|
||||||
|
* @param object $query
|
||||||
|
* @param bool $isSubQuery
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function QueryParser($query = NULL, $isSubQuery = false) {
|
function QueryParser($query = NULL, $isSubQuery = false) {
|
||||||
if ($query)
|
if ($query)
|
||||||
$this->queryTag = new QueryTag($query, $isSubQuery);
|
$this->queryTag = new QueryTag($query, $isSubQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return table information
|
||||||
|
* @param object $query_id
|
||||||
|
* @param bool $table_name
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
function getTableInfo($query_id, $table_name) {
|
function getTableInfo($query_id, $table_name) {
|
||||||
$column_type = array();
|
$column_type = array();
|
||||||
$module = '';
|
$module = '';
|
||||||
|
|
@ -56,6 +76,10 @@
|
||||||
return $column_type;
|
return $column_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Change code string from queryTag object
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function toString() {
|
function toString() {
|
||||||
return "<?php if(!defined('__ZBXE__')) exit();\n"
|
return "<?php if(!defined('__ZBXE__')) exit();\n"
|
||||||
. $this->queryTag->toString()
|
. $this->queryTag->toString()
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,57 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Argument class
|
||||||
|
* @author NHN (developers@xpressengine.com)
|
||||||
|
* @package /classes/xml/xmlquery/argument
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
class Argument {
|
class Argument {
|
||||||
|
/**
|
||||||
|
* argument value
|
||||||
|
* @var mixed
|
||||||
|
*/
|
||||||
var $value;
|
var $value;
|
||||||
|
/**
|
||||||
|
* argument name
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $name;
|
var $name;
|
||||||
|
/**
|
||||||
|
* argument type
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $type;
|
var $type;
|
||||||
|
/**
|
||||||
|
* result of argument type check
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
var $isValid;
|
var $isValid;
|
||||||
|
/**
|
||||||
|
* error message
|
||||||
|
* @var Object
|
||||||
|
*/
|
||||||
var $errorMessage;
|
var $errorMessage;
|
||||||
|
/**
|
||||||
|
* column operation
|
||||||
|
*/
|
||||||
var $column_operation;
|
var $column_operation;
|
||||||
|
/**
|
||||||
|
* Check if arg value is user submnitted or default
|
||||||
|
* @var mixed
|
||||||
|
*/
|
||||||
|
var $uses_default_value;
|
||||||
|
/**
|
||||||
|
* Caches escaped and toString value so that the parsing won't happen multiple times
|
||||||
|
* @var mixed
|
||||||
|
*/
|
||||||
|
var $_value; //
|
||||||
|
|
||||||
var $uses_default_value; // Check if arg value is user submnitted or default
|
/**
|
||||||
var $_value; // Caches escaped and toString value so that the parsing won't happen multiple times;
|
* constructor
|
||||||
|
* @param string $name
|
||||||
|
* @param mixed $value
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function Argument($name, $value) {
|
function Argument($name, $value) {
|
||||||
$this->value = $value;
|
$this->value = $value;
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
|
|
@ -60,6 +100,11 @@ class Argument {
|
||||||
return $this->value;
|
return $this->value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mixed value to string
|
||||||
|
* @param mixed $value
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function toString($value) {
|
function toString($value) {
|
||||||
if (is_array($value)) {
|
if (is_array($value)) {
|
||||||
if (count($value) === 0)
|
if (count($value) === 0)
|
||||||
|
|
@ -71,6 +116,11 @@ class Argument {
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* escape value
|
||||||
|
* @param mixed $value
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
function escapeValue($value) {
|
function escapeValue($value) {
|
||||||
$column_type = $this->getType();
|
$column_type = $this->getType();
|
||||||
if ($column_type == 'column_name') {
|
if ($column_type == 'column_name') {
|
||||||
|
|
@ -106,6 +156,11 @@ class Argument {
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* escape string value
|
||||||
|
* @param string $value
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function _escapeStringValue($value) {
|
function _escapeStringValue($value) {
|
||||||
$db = &DB::getInstance();
|
$db = &DB::getInstance();
|
||||||
$value = $db->addQuotes($value);
|
$value = $db->addQuotes($value);
|
||||||
|
|
@ -135,6 +190,11 @@ class Argument {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* check filter by filter type
|
||||||
|
* @param string $filter_type
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function checkFilter($filter_type) {
|
function checkFilter($filter_type) {
|
||||||
if (isset($this->value) && $this->value != '') {
|
if (isset($this->value) && $this->value != '') {
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,25 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* ConditionArgument class
|
||||||
|
* @author NHN (developers@xpressengine.com)
|
||||||
|
* @package /classes/xml/xmlquery/argument
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
class ConditionArgument extends Argument {
|
class ConditionArgument extends Argument {
|
||||||
|
/**
|
||||||
|
* Operator keyword. for example 'in', 'notint', 'between'
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $operation;
|
var $operation;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* constructor
|
||||||
|
* @param string $name
|
||||||
|
* @param mixed $value
|
||||||
|
* @param string $operation
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function ConditionArgument($name, $value, $operation){
|
function ConditionArgument($name, $value, $operation){
|
||||||
if(isset($value) && in_array($operation, array('in', 'notin','not_in', 'between')) && !is_array($value) && $value != ''){
|
if(isset($value) && in_array($operation, array('in', 'notin','not_in', 'between')) && !is_array($value) && $value != ''){
|
||||||
$value = str_replace(' ', '', $value);
|
$value = str_replace(' ', '', $value);
|
||||||
|
|
@ -14,6 +30,10 @@
|
||||||
$this->operation = $operation;
|
$this->operation = $operation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create condition value. set $this->value
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function createConditionValue(){
|
function createConditionValue(){
|
||||||
if(!isset($this->value)) return;
|
if(!isset($this->value)) return;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* SortArgument class
|
||||||
|
* @author NHN (developers@xpressengine.com)
|
||||||
|
* @package /classes/xml/xmlquery/argument
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
class SortArgument extends Argument {
|
class SortArgument extends Argument {
|
||||||
|
|
||||||
function getValue(){
|
function getValue(){
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,53 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* DefaultValue class
|
||||||
|
* @author NHN (developers@xpressengine.com)
|
||||||
|
* @package /classes/xml/xmlquery/queryargument
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
class DefaultValue {
|
class DefaultValue {
|
||||||
|
/**
|
||||||
|
* Column name
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $column_name;
|
var $column_name;
|
||||||
|
/**
|
||||||
|
* Value
|
||||||
|
* @var mixed
|
||||||
|
*/
|
||||||
var $value;
|
var $value;
|
||||||
|
/**
|
||||||
|
* sequnence status
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
var $is_sequence = false;
|
var $is_sequence = false;
|
||||||
|
/**
|
||||||
|
* operation status
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
var $is_operation = false;
|
var $is_operation = false;
|
||||||
|
/**
|
||||||
|
* operation
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $operation = '';
|
var $operation = '';
|
||||||
|
/**
|
||||||
|
* Checks if value is plain string or name of XE function (ipaddress, plus, etc).
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
var $_is_string = false;
|
||||||
|
/**
|
||||||
|
* Checks if value is string resulted from evaluating a piece of PHP code (see $_SERVER[REMOTE_ADDR])
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
var $_is_string_from_function = false;
|
||||||
|
|
||||||
var $_is_string = false; ///< Checks if value is plain string or name of XE function (ipaddress, plus, etc).
|
/**
|
||||||
var $_is_string_from_function = false; //< Checks if value is string resulted from evaluating a piece of PHP code (see $_SERVER[REMOTE_ADDR])
|
* constructor
|
||||||
|
* @param string $column_name column name
|
||||||
|
* @param mixed $value value
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function DefaultValue($column_name, $value){
|
function DefaultValue($column_name, $value){
|
||||||
$dbParser = &DB::getParser();
|
$dbParser = &DB::getParser();
|
||||||
$this->column_name = $dbParser->parseColumnName($column_name);
|
$this->column_name = $dbParser->parseColumnName($column_name);
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,53 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* QueryArgument class
|
||||||
|
* @author NHN (developers@xpressengine.com)
|
||||||
|
* @package /classes/xml/xmlquery/queryargument
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
class QueryArgument {
|
class QueryArgument {
|
||||||
|
/**
|
||||||
|
* Argument name
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $argument_name;
|
var $argument_name;
|
||||||
|
/**
|
||||||
|
* Variable name
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $variable_name;
|
var $variable_name;
|
||||||
|
/**
|
||||||
|
* Argument validator
|
||||||
|
* @var QueryArgumentValidator
|
||||||
|
*/
|
||||||
var $argument_validator;
|
var $argument_validator;
|
||||||
|
/**
|
||||||
|
* Column name
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $column_name;
|
var $column_name;
|
||||||
|
/**
|
||||||
|
* Table name
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $table_name;
|
var $table_name;
|
||||||
|
/**
|
||||||
|
* Operation
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $operation;
|
var $operation;
|
||||||
|
/**
|
||||||
|
* Ignore value
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
var $ignore_value;
|
var $ignore_value;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* constructor
|
||||||
|
* @param object $tag tag object
|
||||||
|
* @param bool $ignore_value
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function QueryArgument($tag, $ignore_value = false) {
|
function QueryArgument($tag, $ignore_value = false) {
|
||||||
static $number_of_arguments = 0;
|
static $number_of_arguments = 0;
|
||||||
|
|
||||||
|
|
@ -64,6 +102,10 @@ class QueryArgument {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Change QueryArgument object to string
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function toString() {
|
function toString() {
|
||||||
if ($this->isConditionArgument()) {
|
if ($this->isConditionArgument()) {
|
||||||
// Instantiation
|
// Instantiation
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,15 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* SortQueryArgument class
|
||||||
|
* @author NHN (developers@xpressengine.com)
|
||||||
|
* @package /classes/xml/xmlquery/queryargument
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
class SortQueryArgument extends QueryArgument{
|
class SortQueryArgument extends QueryArgument{
|
||||||
|
/**
|
||||||
|
* Change SortQueryArgument object to string
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function toString(){
|
function toString(){
|
||||||
$arg = sprintf("\n" . '${\'%s_argument\'} = new SortArgument(\'%s\', %s);' . "\n"
|
$arg = sprintf("\n" . '${\'%s_argument\'} = new SortArgument(\'%s\', %s);' . "\n"
|
||||||
, $this->argument_name
|
, $this->argument_name
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,56 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* QueryArgumentValidator class
|
||||||
|
* @author NHN (developers@xpressengine.com)
|
||||||
|
* @package /classes/xml/xmlquery/queryargument/validator
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
class QueryArgumentValidator {
|
class QueryArgumentValidator {
|
||||||
|
/**
|
||||||
|
* Argument name
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $argument_name;
|
var $argument_name;
|
||||||
|
/**
|
||||||
|
* Default value
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $default_value;
|
var $default_value;
|
||||||
|
/**
|
||||||
|
* Notnull status setting, if value should be not null, this value is 'notnull'
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $notnull;
|
var $notnull;
|
||||||
|
/**
|
||||||
|
* Filter for value type, for example number
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $filter;
|
var $filter;
|
||||||
|
/**
|
||||||
|
* Minimum length for value
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
var $min_length;
|
var $min_length;
|
||||||
|
/**
|
||||||
|
* Maximum length for value
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
var $max_length;
|
var $max_length;
|
||||||
|
|
||||||
var $validator_string;
|
var $validator_string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Query argument for validate
|
||||||
|
* @var QueryArgument object
|
||||||
|
*/
|
||||||
var $argument;
|
var $argument;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* constructor
|
||||||
|
* @param Xml_Node_ $tag tag object by Query xml file parse
|
||||||
|
* @param QueryArgument $argument
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function QueryArgumentValidator($tag, $argument){
|
function QueryArgumentValidator($tag, $argument){
|
||||||
$this->argument = $argument;
|
$this->argument = $argument;
|
||||||
$this->argument_name = $this->argument->getArgumentName();
|
$this->argument_name = $this->argument->getArgumentName();
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,27 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @class ColumnTag
|
* ColumnTag class
|
||||||
* @author Arnia Software
|
* Models the <column> tag inside an XML Query file
|
||||||
* @brief Models the <column> tag inside an XML Query file
|
|
||||||
*
|
|
||||||
* Since the <column> tag supports different attributes depending on
|
* Since the <column> tag supports different attributes depending on
|
||||||
* the type of query (select, update, insert, delete) this is only
|
* the type of query (select, update, insert, delete) this is only
|
||||||
* the base class for the classes that will model each type <column> tag.
|
* the base class for the classes that will model each type <column> tag.
|
||||||
*
|
*
|
||||||
**/
|
* @author Arnia Software
|
||||||
|
* @package /classes/xml/xmlquery/tags/column
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
class ColumnTag {
|
class ColumnTag {
|
||||||
|
/**
|
||||||
|
* Column name
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $name;
|
var $name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* constructor
|
||||||
|
* @param string $name
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function ColumnTag($name){
|
function ColumnTag($name){
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,24 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @class InsertColumnTag
|
* InsertColumnTag
|
||||||
* @author Arnia Software
|
* Models the <column> tag inside an XML Query file whose action is 'insert'
|
||||||
* @brief Models the <column> tag inside an XML Query file whose action is 'insert'
|
|
||||||
*
|
*
|
||||||
**/
|
* @author Arnia Software
|
||||||
|
* @package /classes/xml/xmlquery/tags/column
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
class InsertColumnTag extends ColumnTag {
|
class InsertColumnTag extends ColumnTag {
|
||||||
|
/**
|
||||||
|
* argument
|
||||||
|
* @var QueryArgument object
|
||||||
|
*/
|
||||||
var $argument;
|
var $argument;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* constructor
|
||||||
|
* @param object $column
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function InsertColumnTag($column) {
|
function InsertColumnTag($column) {
|
||||||
parent::ColumnTag($column->attrs->name);
|
parent::ColumnTag($column->attrs->name);
|
||||||
$dbParser = DB::getParser();
|
$dbParser = DB::getParser();
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @class InsertColumnTagWithoutArgument
|
* InsertColumnTagWithoutArgument
|
||||||
* @author Arnia Software
|
* Models the <column> tag inside an XML Query file whose action is 'insert-select'
|
||||||
* @brief Models the <column> tag inside an XML Query file whose action is 'insert-select'
|
|
||||||
*
|
*
|
||||||
**/
|
* @author Arnia Software
|
||||||
|
* @package /classes/xml/xmlquery/tags/column
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
class InsertColumnTagWithoutArgument extends ColumnTag {
|
class InsertColumnTagWithoutArgument extends ColumnTag {
|
||||||
|
/**
|
||||||
|
* constructor
|
||||||
|
* @param object $column
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function InsertColumnTagWithoutArgument($column) {
|
function InsertColumnTagWithoutArgument($column) {
|
||||||
parent::ColumnTag($column->attrs->name);
|
parent::ColumnTag($column->attrs->name);
|
||||||
$dbParser = DB::getParser();
|
$dbParser = DB::getParser();
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,24 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @class InsertColumnsTag
|
* InsertColumnsTag class
|
||||||
* @author Arnia Software
|
* Models the <column> tag inside an XML Query file whose action is 'insert'
|
||||||
* @brief Models the <column> tag inside an XML Query file whose action is 'insert'
|
|
||||||
*
|
*
|
||||||
**/
|
* @author Arnia Software
|
||||||
|
* @package /classes/xml/xmlquery/tags/column
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
class InsertColumnsTag{
|
class InsertColumnsTag{
|
||||||
|
/**
|
||||||
|
* Column list
|
||||||
|
* @var array value is InsertColumnTag object
|
||||||
|
*/
|
||||||
var $columns;
|
var $columns;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* constructor
|
||||||
|
* @param array|string $xml_columns
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function InsertColumnsTag($xml_columns) {
|
function InsertColumnsTag($xml_columns) {
|
||||||
$this->columns = array();
|
$this->columns = array();
|
||||||
|
|
||||||
|
|
@ -24,6 +34,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* InsertColumnTag object to string
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function toString(){
|
function toString(){
|
||||||
$output_columns = 'array(' . PHP_EOL;
|
$output_columns = 'array(' . PHP_EOL;
|
||||||
foreach($this->columns as $column){
|
foreach($this->columns as $column){
|
||||||
|
|
@ -34,6 +48,10 @@
|
||||||
return $output_columns;
|
return $output_columns;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return argument list
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
function getArguments(){
|
function getArguments(){
|
||||||
$arguments = array();
|
$arguments = array();
|
||||||
foreach($this->columns as $column){
|
foreach($this->columns as $column){
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,29 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class SelectColumnTag
|
* SelectColumnTag
|
||||||
* @author Arnia Software
|
* Models the <column> tag inside an XML Query file whose action is 'select'
|
||||||
* @brief Models the <column> tag inside an XML Query file whose action is 'select'
|
|
||||||
*
|
*
|
||||||
**/
|
* @author Arnia Software
|
||||||
|
* @package /classes/xml/xmlquery/tags/column
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
class SelectColumnTag extends ColumnTag{
|
class SelectColumnTag extends ColumnTag{
|
||||||
|
/**
|
||||||
|
* alias
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $alias;
|
var $alias;
|
||||||
|
/**
|
||||||
|
* click count status
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
var $click_count;
|
var $click_count;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* constructor
|
||||||
|
* @param string|object $column
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function SelectColumnTag($column){
|
function SelectColumnTag($column){
|
||||||
if ($column == "*" || $column->attrs->name == '*')
|
if ($column == "*" || $column->attrs->name == '*')
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,23 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* SelectColumnTag class
|
||||||
|
*
|
||||||
|
* @author Arnia Software
|
||||||
|
* @package /classes/xml/xmlquery/tags/column
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
class SelectColumnsTag {
|
class SelectColumnsTag {
|
||||||
|
/**
|
||||||
|
* Column list
|
||||||
|
* @var array value is SelectColumnTag object
|
||||||
|
*/
|
||||||
var $columns;
|
var $columns;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* constructor
|
||||||
|
* @param Xml_Node_ $xml_columns
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function SelectColumnsTag($xml_columns_tag){
|
function SelectColumnsTag($xml_columns_tag){
|
||||||
if (!$xml_columns_tag)
|
if (!$xml_columns_tag)
|
||||||
$xml_columns_tag = new Xml_Node_();
|
$xml_columns_tag = new Xml_Node_();
|
||||||
|
|
@ -35,6 +50,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SelectColumnTag object to string
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function toString(){
|
function toString(){
|
||||||
$output_columns = 'array(' . PHP_EOL;
|
$output_columns = 'array(' . PHP_EOL;
|
||||||
foreach($this->columns as $column){
|
foreach($this->columns as $column){
|
||||||
|
|
@ -48,6 +67,10 @@
|
||||||
return $output_columns;
|
return $output_columns;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return argument list
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
function getArguments(){
|
function getArguments(){
|
||||||
$arguments = array();
|
$arguments = array();
|
||||||
foreach($this->columns as $column){
|
foreach($this->columns as $column){
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,29 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class UpdateColumnTag
|
* UpdateColumnTag
|
||||||
* @author Arnia Software
|
* Models the <column> tag inside an XML Query file whose action is 'update'
|
||||||
* @brief Models the <column> tag inside an XML Query file whose action is 'update'
|
|
||||||
*
|
*
|
||||||
**/
|
* @author Arnia Software
|
||||||
|
* @package /classes/xml/xmlquery/tags/column
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
class UpdateColumnTag extends ColumnTag {
|
class UpdateColumnTag extends ColumnTag {
|
||||||
|
/**
|
||||||
|
* argument
|
||||||
|
* @var QueryArgument object
|
||||||
|
*/
|
||||||
var $argument;
|
var $argument;
|
||||||
|
/**
|
||||||
|
* default value
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $default_value;
|
var $default_value;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* constructor
|
||||||
|
* @param object $column
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function UpdateColumnTag($column) {
|
function UpdateColumnTag($column) {
|
||||||
parent::ColumnTag($column->attrs->name);
|
parent::ColumnTag($column->attrs->name);
|
||||||
$dbParser = DB::getParser();
|
$dbParser = DB::getParser();
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,24 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class UpdateColumnsTag
|
* UpdateColumnsTag
|
||||||
* @author Arnia Software
|
* Models the <column> tag inside an XML Query file whose action is 'update'
|
||||||
* @brief Models the <column> tag inside an XML Query file whose action is 'update'
|
|
||||||
*
|
*
|
||||||
**/
|
* @author Arnia Software
|
||||||
|
* @package /classes/xml/xmlquery/tags/column
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
class UpdateColumnsTag{
|
class UpdateColumnsTag{
|
||||||
|
/**
|
||||||
|
* Column list
|
||||||
|
* @var array value is UpdateColumnTag object
|
||||||
|
*/
|
||||||
var $columns;
|
var $columns;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* constructor
|
||||||
|
* @param array|string $xml_columns
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function UpdateColumnsTag($xml_columns) {
|
function UpdateColumnsTag($xml_columns) {
|
||||||
$this->columns = array();
|
$this->columns = array();
|
||||||
|
|
||||||
|
|
@ -21,6 +30,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UpdateColumnTag object to string
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function toString(){
|
function toString(){
|
||||||
$output_columns = 'array(' . PHP_EOL;
|
$output_columns = 'array(' . PHP_EOL;
|
||||||
foreach($this->columns as $column){
|
foreach($this->columns as $column){
|
||||||
|
|
@ -31,6 +44,10 @@
|
||||||
return $output_columns;
|
return $output_columns;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return argument list
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
function getArguments(){
|
function getArguments(){
|
||||||
$arguments = array();
|
$arguments = array();
|
||||||
foreach($this->columns as $column){
|
foreach($this->columns as $column){
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,29 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* ConditionGroupTag class
|
||||||
|
*
|
||||||
|
* @author Arnia Software
|
||||||
|
* @package /classes/xml/xmlquery/tags/condition
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
class ConditionGroupTag {
|
class ConditionGroupTag {
|
||||||
|
/**
|
||||||
|
* condition list
|
||||||
|
* @var string|array value is ConditionTag object
|
||||||
|
*/
|
||||||
var $conditions;
|
var $conditions;
|
||||||
|
/**
|
||||||
|
* pipe
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $pipe;
|
var $pipe;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* constructor
|
||||||
|
* @param string|array $conditions
|
||||||
|
* @param string $pipe
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function ConditionGroupTag($conditions, $pipe = ""){
|
function ConditionGroupTag($conditions, $pipe = ""){
|
||||||
$this->pipe = $pipe;
|
$this->pipe = $pipe;
|
||||||
|
|
||||||
|
|
@ -19,6 +39,10 @@
|
||||||
return $this->conditions;
|
return $this->conditions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ConditionTag object to string
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function getConditionGroupString(){
|
function getConditionGroupString(){
|
||||||
$conditions_string = 'array('.PHP_EOL;
|
$conditions_string = 'array('.PHP_EOL;
|
||||||
foreach($this->conditions as $condition){
|
foreach($this->conditions as $condition){
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,54 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* ConditionTag
|
||||||
|
* Models the <condition> tag inside an XML Query file. Base class.
|
||||||
|
*
|
||||||
|
* @author Corina
|
||||||
|
* @package /classes/xml/xmlquery/tags/condition
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
|
class ConditionTag {
|
||||||
|
/**
|
||||||
|
* operation for example 'in', 'between', 'not in'...
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
var $operation;
|
||||||
|
/**
|
||||||
|
* Column name
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
var $column_name;
|
||||||
|
/**
|
||||||
|
* Pipe
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
var $pipe;
|
||||||
|
/**
|
||||||
|
* Argument name
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
var $argument_name;
|
||||||
|
/**
|
||||||
|
* QueryArgument object
|
||||||
|
* @var QueryArgument
|
||||||
|
*/
|
||||||
|
var $argument;
|
||||||
|
/**
|
||||||
|
* Default column
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
var $default_column;
|
||||||
|
/**
|
||||||
|
* QueryTag object
|
||||||
|
* @var QueryTag
|
||||||
|
*/
|
||||||
|
var $query;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class ConditionTag
|
* constructor
|
||||||
* @author Corina
|
* @param object $condition
|
||||||
* @brief Models the <condition> tag inside an XML Query file. Base class.
|
* @return void
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ConditionTag {
|
|
||||||
var $operation;
|
|
||||||
var $column_name;
|
|
||||||
|
|
||||||
var $pipe;
|
|
||||||
var $argument_name;
|
|
||||||
var $argument;
|
|
||||||
var $default_column;
|
|
||||||
|
|
||||||
var $query;
|
|
||||||
function ConditionTag($condition){
|
function ConditionTag($condition){
|
||||||
$this->operation = $condition->attrs->operation;
|
$this->operation = $condition->attrs->operation;
|
||||||
$this->pipe = $condition->attrs->pipe;
|
$this->pipe = $condition->attrs->pipe;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,23 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* ConditionsTag class
|
||||||
|
*
|
||||||
|
* @author Arnia Software
|
||||||
|
* @package /classes/xml/xmlquery/tags/condition
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
class ConditionsTag {
|
class ConditionsTag {
|
||||||
|
/**
|
||||||
|
* ConditionGroupTag list
|
||||||
|
* @var array value is ConditionGroupTag object
|
||||||
|
*/
|
||||||
var $condition_groups;
|
var $condition_groups;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* constructor
|
||||||
|
* @param object $xml_conditions
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function ConditionsTag($xml_conditions){
|
function ConditionsTag($xml_conditions){
|
||||||
$this->condition_groups = array();
|
$this->condition_groups = array();
|
||||||
if (!$xml_conditions)
|
if (!$xml_conditions)
|
||||||
|
|
@ -29,6 +45,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ConditionGroupTag object to string
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function toString(){
|
function toString(){
|
||||||
$output_conditions = 'array(' . PHP_EOL;
|
$output_conditions = 'array(' . PHP_EOL;
|
||||||
foreach($this->condition_groups as $condition){
|
foreach($this->condition_groups as $condition){
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,17 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* JoinConditionsTag class
|
||||||
|
*
|
||||||
|
* @author Corina
|
||||||
|
* @package /classes/xml/xmlquery/tags/condition
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
class JoinConditionsTag extends ConditionsTag {
|
class JoinConditionsTag extends ConditionsTag {
|
||||||
|
/**
|
||||||
|
* constructor
|
||||||
|
* @param object $xml_conditions
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function JoinConditionsTag($xml_conditions){
|
function JoinConditionsTag($xml_conditions){
|
||||||
parent::ConditionsTag($xml_conditions);
|
parent::ConditionsTag($xml_conditions);
|
||||||
$this->condition_groups[0]->conditions[0]->setPipe("");
|
$this->condition_groups[0]->conditions[0]->setPipe("");
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,23 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* GroupsTag class
|
||||||
|
*
|
||||||
|
* @author Arnia Software
|
||||||
|
* @package /classes/xml/xmlquery/tags/group
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
class GroupsTag {
|
class GroupsTag {
|
||||||
|
/**
|
||||||
|
* column list
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
var $groups;
|
var $groups;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* constructor
|
||||||
|
* @param array|string $xml_groups
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function GroupsTag($xml_groups){
|
function GroupsTag($xml_groups){
|
||||||
$this->groups = array();
|
$this->groups = array();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,43 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* IndexTag class
|
||||||
|
*
|
||||||
|
* @author Arnia Software
|
||||||
|
* @package /classes/xml/xmlquery/tags/navigation
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
class IndexTag {
|
class IndexTag {
|
||||||
|
/**
|
||||||
|
* argument name
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $argument_name;
|
var $argument_name;
|
||||||
|
/**
|
||||||
|
* QueryArgument object
|
||||||
|
* @var QueryArgument
|
||||||
|
*/
|
||||||
var $argument;
|
var $argument;
|
||||||
|
/**
|
||||||
|
* Default value
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $default;
|
var $default;
|
||||||
|
/**
|
||||||
|
* Sort order
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $sort_order;
|
var $sort_order;
|
||||||
|
/**
|
||||||
|
* Sort order argument
|
||||||
|
* @var SortQueryArgument object
|
||||||
|
*/
|
||||||
var $sort_order_argument;
|
var $sort_order_argument;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* constructor
|
||||||
|
* @param object $index
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function IndexTag($index){
|
function IndexTag($index){
|
||||||
$this->argument_name = $index->attrs->var;
|
$this->argument_name = $index->attrs->var;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,38 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* LimitTag class
|
||||||
|
*
|
||||||
|
* @author Arnia Software
|
||||||
|
* @package /classes/xml/xmlquery/tags/navigation
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
class LimitTag {
|
class LimitTag {
|
||||||
|
/**
|
||||||
|
* Value is relate to limit query
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
var $arguments;
|
var $arguments;
|
||||||
|
/**
|
||||||
|
* QueryArgument object
|
||||||
|
* @var QueryArgument
|
||||||
|
*/
|
||||||
var $page;
|
var $page;
|
||||||
|
/**
|
||||||
|
* QueryArgument object
|
||||||
|
* @var QueryArgument
|
||||||
|
*/
|
||||||
var $page_count;
|
var $page_count;
|
||||||
|
/**
|
||||||
|
* QueryArgument object
|
||||||
|
* @var QueryArgument
|
||||||
|
*/
|
||||||
var $list_count;
|
var $list_count;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* constructor
|
||||||
|
* @param object $index
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function LimitTag($index){
|
function LimitTag($index){
|
||||||
if($index->page && $index->page->attrs && $index->page_count && $index->page_count->attrs){
|
if($index->page && $index->page->attrs && $index->page_count && $index->page_count->attrs){
|
||||||
$this->page = new QueryArgument($index->page);
|
$this->page = new QueryArgument($index->page);
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,43 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* NavigationTag class
|
||||||
|
*
|
||||||
|
* @author Arnia Software
|
||||||
|
* @package /classes/xml/xmlquery/tags/navigation
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
class NavigationTag {
|
class NavigationTag {
|
||||||
|
/**
|
||||||
|
* Order
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
var $order;
|
var $order;
|
||||||
|
/**
|
||||||
|
* List count
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
var $list_count;
|
var $list_count;
|
||||||
|
/**
|
||||||
|
* Page count
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
var $page_count;
|
var $page_count;
|
||||||
|
/**
|
||||||
|
* Page
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
var $page;
|
var $page;
|
||||||
|
/**
|
||||||
|
* Limit
|
||||||
|
* @var LimitTag object
|
||||||
|
*/
|
||||||
var $limit;
|
var $limit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* constructor
|
||||||
|
* @param object $xml_navigation
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function NavigationTag($xml_navigation){
|
function NavigationTag($xml_navigation){
|
||||||
$this->order = array();
|
$this->order = array();
|
||||||
if($xml_navigation) {
|
if($xml_navigation) {
|
||||||
|
|
@ -31,6 +63,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NavigationTag object to string
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function getOrderByString(){
|
function getOrderByString(){
|
||||||
$output = 'array(' . PHP_EOL;
|
$output = 'array(' . PHP_EOL;
|
||||||
foreach($this->order as $order){
|
foreach($this->order as $order){
|
||||||
|
|
@ -41,6 +77,10 @@
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LimitTag object to string
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function getLimitString(){
|
function getLimitString(){
|
||||||
if ($this->limit) return $this->limit->toString();
|
if ($this->limit) return $this->limit->toString();
|
||||||
else return "";
|
else return "";
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,104 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* QueryTag class
|
||||||
|
*
|
||||||
|
* @author Arnia Software
|
||||||
|
* @package /classes/xml/xmlquery/tags/query
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
class QueryTag {
|
class QueryTag {
|
||||||
|
/**
|
||||||
|
* Action for example, 'select', 'insert', 'delete'...
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $action;
|
var $action;
|
||||||
|
/**
|
||||||
|
* Query id
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $query_id;
|
var $query_id;
|
||||||
|
/**
|
||||||
|
* Priority
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $priority;
|
var $priority;
|
||||||
|
/**
|
||||||
|
* column type list
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
var $column_type;
|
var $column_type;
|
||||||
|
/**
|
||||||
|
* Query stdClass object
|
||||||
|
* @var object
|
||||||
|
*/
|
||||||
var $query;
|
var $query;
|
||||||
//xml tags
|
/**
|
||||||
|
* Columns in xml tags
|
||||||
|
* @var object
|
||||||
|
*/
|
||||||
var $columns;
|
var $columns;
|
||||||
|
/**
|
||||||
|
* Tables in xml tags
|
||||||
|
* @var object
|
||||||
|
*/
|
||||||
var $tables;
|
var $tables;
|
||||||
|
/**
|
||||||
|
* Subquery in xml tags
|
||||||
|
* @var object
|
||||||
|
*/
|
||||||
var $subquery;
|
var $subquery;
|
||||||
|
/**
|
||||||
|
* Conditions in xml tags
|
||||||
|
* @var object
|
||||||
|
*/
|
||||||
var $conditions;
|
var $conditions;
|
||||||
|
/**
|
||||||
|
* Groups in xml tags
|
||||||
|
* @var object
|
||||||
|
*/
|
||||||
var $groups;
|
var $groups;
|
||||||
|
/**
|
||||||
|
* Navigation in xml tags
|
||||||
|
* @var object
|
||||||
|
*/
|
||||||
var $navigation;
|
var $navigation;
|
||||||
|
/**
|
||||||
|
* Arguments in xml tags
|
||||||
|
* @var object
|
||||||
|
*/
|
||||||
var $arguments;
|
var $arguments;
|
||||||
|
/**
|
||||||
|
* PreBuff
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $preBuff;
|
var $preBuff;
|
||||||
|
/**
|
||||||
|
* Buff
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $buff;
|
var $buff;
|
||||||
|
/**
|
||||||
|
* Subquery status
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
var $isSubQuery;
|
var $isSubQuery;
|
||||||
|
/**
|
||||||
|
* Join type
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $join_type;
|
var $join_type;
|
||||||
|
/**
|
||||||
|
* alias
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
var $alias;
|
var $alias;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* constructor
|
||||||
|
* @param object $query
|
||||||
|
* @param bool $isSubQuery
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function QueryTag($query, $isSubQuery = false) {
|
function QueryTag($query, $isSubQuery = false) {
|
||||||
$this->action = $query->attrs->action;
|
$this->action = $query->attrs->action;
|
||||||
$this->query_id = $query->attrs->id;
|
$this->query_id = $query->attrs->id;
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,25 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class HintTableTag
|
* HintTableTag
|
||||||
* @author Arnia Sowftare
|
* Models the <table> tag inside an XML Query file and the corresponding <index_hint> tag
|
||||||
* @brief Models the <table> tag inside an XML Query file
|
|
||||||
* and the corresponding <index_hint> tag
|
|
||||||
*
|
*
|
||||||
|
* @author Arnia Sowftare
|
||||||
|
* @package /classes/xml/xmlquery/tags/table
|
||||||
|
* @version 0.1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class HintTableTag extends TableTag {
|
class HintTableTag extends TableTag {
|
||||||
|
/**
|
||||||
|
* Action for example, 'select', 'insert', 'delete'...
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
var $index;
|
var $index;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initialises Table Tag properties
|
* constructor
|
||||||
* @param XML <table> tag $table
|
* Initialises Table Tag properties
|
||||||
|
* @param object $table XML <table> tag
|
||||||
|
* @param array $index
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function HintTableTag($table, $index){
|
function HintTableTag($table, $index){
|
||||||
parent::TableTag($table);
|
parent::TableTag($table);
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class TableTag
|
* TableTag
|
||||||
* @author Arnia Sowftare
|
* Models the <table> tag inside an XML Query file
|
||||||
* @brief Models the <table> tag inside an XML Query file
|
|
||||||
*
|
|
||||||
* @abstract
|
* @abstract
|
||||||
* Example
|
* Example
|
||||||
* <table name="modules" />
|
* <table name="modules" />
|
||||||
|
|
@ -16,18 +13,49 @@
|
||||||
* - permitted values: 'left join','left outer join','right join','right outer join'
|
* - permitted values: 'left join','left outer join','right join','right outer join'
|
||||||
* Children
|
* Children
|
||||||
* Can have children of type <conditions>
|
* Can have children of type <conditions>
|
||||||
|
*
|
||||||
|
* @author Arnia Sowftare
|
||||||
|
* @package /classes/xml/xmlquery/tags/table
|
||||||
|
* @version 0.1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class TableTag {
|
class TableTag {
|
||||||
var $unescaped_name;
|
|
||||||
var $name;
|
|
||||||
var $alias;
|
|
||||||
var $join_type;
|
|
||||||
var $conditions;
|
|
||||||
var $conditionsTag;
|
|
||||||
/**
|
/**
|
||||||
* @brief Initialises Table Tag properties
|
* Unescaped name
|
||||||
* @param XML <table> tag $table
|
* @var string
|
||||||
|
*/
|
||||||
|
var $unescaped_name;
|
||||||
|
/**
|
||||||
|
* name
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
var $name;
|
||||||
|
/**
|
||||||
|
* alias
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
var $alias;
|
||||||
|
/**
|
||||||
|
* Join type
|
||||||
|
* @example 'left join', 'left outer join', 'right join', 'right outer join'
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
var $join_type;
|
||||||
|
/**
|
||||||
|
* Condition object
|
||||||
|
* @var object
|
||||||
|
*/
|
||||||
|
var $conditions;
|
||||||
|
/**
|
||||||
|
* JoinConditionsTag
|
||||||
|
* @var JoinConditionsTag object
|
||||||
|
*/
|
||||||
|
var $conditionsTag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* constructor
|
||||||
|
* Initialises Table Tag properties
|
||||||
|
* @param object $table XML <table> tag
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function TableTag($table){
|
function TableTag($table){
|
||||||
$dbParser = DB::getParser();
|
$dbParser = DB::getParser();
|
||||||
|
|
@ -61,7 +89,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns string for printing in PHP query cache file
|
* Returns string for printing in PHP query cache file
|
||||||
* The string contains code for instantiation of either
|
* The string contains code for instantiation of either
|
||||||
* a Table or a JoinTable object
|
* a Table or a JoinTable object
|
||||||
* @return string
|
* @return string
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class TablesTag
|
* TablesTag class
|
||||||
* @author Arnia Sowftare
|
* Models the <tables> tag inside an XML Query file
|
||||||
* @brief Models the <tables> tag inside an XML Query file
|
|
||||||
*
|
|
||||||
* @abstract
|
* @abstract
|
||||||
* Example
|
* Example
|
||||||
* <tables>
|
* <tables>
|
||||||
|
|
@ -14,11 +11,24 @@
|
||||||
* None.
|
* None.
|
||||||
* Children
|
* Children
|
||||||
* Can have children of type <table> or <query>
|
* Can have children of type <table> or <query>
|
||||||
|
*
|
||||||
|
* @author Arnia Sowftare
|
||||||
|
* @package /classes/xml/xmlquery/tags/table
|
||||||
|
* @version 0.1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class TablesTag {
|
class TablesTag {
|
||||||
|
/**
|
||||||
|
* Table list
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
var $tables;
|
var $tables;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* constructor
|
||||||
|
* @param object $xml_tables_tag
|
||||||
|
* @param object $xml_index_hints_tag
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function TablesTag($xml_tables_tag, $xml_index_hints_tag = NULL){
|
function TablesTag($xml_tables_tag, $xml_index_hints_tag = NULL){
|
||||||
$this->tables = array();
|
$this->tables = array();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue