mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-23 13:19:56 +09:00
merge from 1.7.3.5(r13153:r13167)
git-svn-id: http://xe-core.googlecode.com/svn/trunk@13168 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
cc47d2b247
commit
2d3f149b5a
2042 changed files with 129266 additions and 126243 deletions
|
|
@ -1,53 +1,61 @@
|
|||
<?php
|
||||
<?php
|
||||
|
||||
/**
|
||||
* ClickCountExpression
|
||||
* @author Arnia Software
|
||||
* @package /classes/db/queryparts/expression
|
||||
* @version 0.1
|
||||
*/
|
||||
class ClickCountExpression extends SelectExpression
|
||||
{
|
||||
|
||||
/**
|
||||
* ClickCountExpression
|
||||
* @author Arnia Software
|
||||
* @package /classes/db/queryparts/expression
|
||||
* @version 0.1
|
||||
* click count
|
||||
* @var bool
|
||||
*/
|
||||
class ClickCountExpression extends SelectExpression {
|
||||
/**
|
||||
* click count
|
||||
* @var bool
|
||||
*/
|
||||
var $click_count;
|
||||
|
||||
/**
|
||||
* constructor
|
||||
* @param string $column_name
|
||||
* @param string $alias
|
||||
* @param bool $click_count
|
||||
* @return void
|
||||
*/
|
||||
function ClickCountExpression($column_name, $alias = NULL, $click_count = false){
|
||||
parent::SelectExpression($column_name, $alias);
|
||||
|
||||
if(!is_bool($click_count)){
|
||||
// error_log("Click_count value for $column_name was not boolean", 0);
|
||||
$this->click_count = false;
|
||||
}
|
||||
$this->click_count = $click_count;
|
||||
var $click_count;
|
||||
|
||||
/**
|
||||
* constructor
|
||||
* @param string $column_name
|
||||
* @param string $alias
|
||||
* @param bool $click_count
|
||||
* @return void
|
||||
*/
|
||||
function ClickCountExpression($column_name, $alias = NULL, $click_count = false)
|
||||
{
|
||||
parent::SelectExpression($column_name, $alias);
|
||||
|
||||
if(!is_bool($click_count))
|
||||
{
|
||||
// error_log("Click_count value for $column_name was not boolean", 0);
|
||||
$this->click_count = false;
|
||||
}
|
||||
|
||||
function show() {
|
||||
return $this->click_count;
|
||||
$this->click_count = $click_count;
|
||||
}
|
||||
|
||||
function show()
|
||||
{
|
||||
return $this->click_count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return column expression, ex) column = column + 1
|
||||
* @return string
|
||||
*/
|
||||
function getExpression()
|
||||
{
|
||||
$db_type = Context::getDBType();
|
||||
if($db_type == 'cubrid')
|
||||
{
|
||||
return "INCR($this->column_name)";
|
||||
}
|
||||
|
||||
/**
|
||||
* Return column expression, ex) column = column + 1
|
||||
* @return string
|
||||
*/
|
||||
function getExpression(){
|
||||
$db_type = Context::getDBType();
|
||||
if($db_type == 'cubrid')
|
||||
{
|
||||
return "INCR($this->column_name)";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "$this->column_name";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "$this->column_name";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
}
|
||||
/* End of file ClickCountExpression.class.php */
|
||||
/* Location: ./classes/db/queryparts/expression/ClickCountExpression.class.php */
|
||||
|
|
|
|||
|
|
@ -1,50 +1,62 @@
|
|||
<?php
|
||||
/**
|
||||
* DeleteExpression
|
||||
*
|
||||
* @author Arnia Software
|
||||
* @package /classes/db/queryparts/expression
|
||||
* @version 0.1
|
||||
* @todo Fix this class
|
||||
*/
|
||||
<?php
|
||||
|
||||
class DeleteExpression extends Expression {
|
||||
/**
|
||||
* column value
|
||||
* @var mixed
|
||||
*/
|
||||
var $value;
|
||||
|
||||
/**
|
||||
* constructor
|
||||
* @param string $column_name
|
||||
* @param mixed $value
|
||||
* @return void
|
||||
*/
|
||||
function DeleteExpression($column_name, $value){
|
||||
parent::Expression($column_name);
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return column expression, ex) column = value
|
||||
* @return string
|
||||
*/
|
||||
function getExpression(){
|
||||
return "$this->column_name = $this->value";
|
||||
}
|
||||
|
||||
function getValue(){
|
||||
// TODO Escape value according to column type instead of variable type
|
||||
if(!is_numeric($this->value)) return "'".$this->value."'";
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
function show(){
|
||||
if(!$this->value) return false;
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* DeleteExpression
|
||||
*
|
||||
* @author Arnia Software
|
||||
* @package /classes/db/queryparts/expression
|
||||
* @version 0.1
|
||||
* @todo Fix this class
|
||||
*/
|
||||
class DeleteExpression extends Expression
|
||||
{
|
||||
|
||||
/**
|
||||
* column value
|
||||
* @var mixed
|
||||
*/
|
||||
var $value;
|
||||
|
||||
/**
|
||||
* constructor
|
||||
* @param string $column_name
|
||||
* @param mixed $value
|
||||
* @return void
|
||||
*/
|
||||
function DeleteExpression($column_name, $value)
|
||||
{
|
||||
parent::Expression($column_name);
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return column expression, ex) column = value
|
||||
* @return string
|
||||
*/
|
||||
function getExpression()
|
||||
{
|
||||
return "$this->column_name = $this->value";
|
||||
}
|
||||
|
||||
?>
|
||||
function getValue()
|
||||
{
|
||||
// TODO Escape value according to column type instead of variable type
|
||||
if(!is_numeric($this->value))
|
||||
{
|
||||
return "'" . $this->value . "'";
|
||||
}
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
function show()
|
||||
{
|
||||
if(!$this->value)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
/* End of file DeleteExpression.class.php */
|
||||
/* Location: ./classes/db/queryparts/expression/DeleteExpression.class.php */
|
||||
|
|
|
|||
|
|
@ -1,44 +1,55 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Expression
|
||||
* Represents an expression used in select/update/insert/delete statements
|
||||
*
|
||||
* Examples (expressions are inside double square brackets):
|
||||
* select [[columnA]], [[columnB as aliasB]] from tableA
|
||||
* update tableA set [[columnA = valueA]] where columnB = something
|
||||
*
|
||||
* @author Corina
|
||||
* @package /classes/db/queryparts/expression
|
||||
* @version 0.1
|
||||
*/
|
||||
class Expression
|
||||
{
|
||||
|
||||
/**
|
||||
* Expression
|
||||
* Represents an expression used in select/update/insert/delete statements
|
||||
*
|
||||
* Examples (expressions are inside double square brackets):
|
||||
* select [[columnA]], [[columnB as aliasB]] from tableA
|
||||
* update tableA set [[columnA = valueA]] where columnB = something
|
||||
*
|
||||
* @author Corina
|
||||
* @package /classes/db/queryparts/expression
|
||||
* @version 0.1
|
||||
* column name
|
||||
* @var string
|
||||
*/
|
||||
class Expression {
|
||||
/**
|
||||
* column name
|
||||
* @var string
|
||||
*/
|
||||
var $column_name;
|
||||
|
||||
/**
|
||||
* constructor
|
||||
* @param string $column_name
|
||||
* @return void
|
||||
*/
|
||||
function Expression($column_name){
|
||||
$this->column_name = $column_name;
|
||||
}
|
||||
|
||||
function getColumnName(){
|
||||
return $this->column_name;
|
||||
}
|
||||
|
||||
function show() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return column expression, ex) column as alias
|
||||
* @return string
|
||||
*/
|
||||
function getExpression() {
|
||||
}
|
||||
var $column_name;
|
||||
|
||||
/**
|
||||
* constructor
|
||||
* @param string $column_name
|
||||
* @return void
|
||||
*/
|
||||
function Expression($column_name)
|
||||
{
|
||||
$this->column_name = $column_name;
|
||||
}
|
||||
|
||||
function getColumnName()
|
||||
{
|
||||
return $this->column_name;
|
||||
}
|
||||
|
||||
function show()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return column expression, ex) column as alias
|
||||
* @return string
|
||||
*/
|
||||
function getExpression()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
/* End of file Expression.class.php */
|
||||
/* Location: ./classes/db/queryparts/expression/Expression.class.php */
|
||||
|
|
|
|||
|
|
@ -1,53 +1,73 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* InsertExpression
|
||||
*
|
||||
* @author Arnia Software
|
||||
* @package /classes/db/queryparts/expression
|
||||
* @version 0.1
|
||||
*/
|
||||
class InsertExpression extends Expression
|
||||
{
|
||||
|
||||
/**
|
||||
* InsertExpression
|
||||
*
|
||||
* @author Arnia Software
|
||||
* @package /classes/db/queryparts/expression
|
||||
* @version 0.1
|
||||
* argument
|
||||
* @var object
|
||||
*/
|
||||
class InsertExpression extends Expression {
|
||||
/**
|
||||
* argument
|
||||
* @var object
|
||||
*/
|
||||
var $argument;
|
||||
var $argument;
|
||||
|
||||
/**
|
||||
* constructor
|
||||
* @param string $column_name
|
||||
* @param object $argument
|
||||
* @return void
|
||||
*/
|
||||
function InsertExpression($column_name, $argument){
|
||||
parent::Expression($column_name);
|
||||
$this->argument = $argument;
|
||||
}
|
||||
/**
|
||||
* constructor
|
||||
* @param string $column_name
|
||||
* @param object $argument
|
||||
* @return void
|
||||
*/
|
||||
function InsertExpression($column_name, $argument)
|
||||
{
|
||||
parent::Expression($column_name);
|
||||
$this->argument = $argument;
|
||||
}
|
||||
|
||||
function getValue($with_values = true){
|
||||
if($with_values)
|
||||
return $this->argument->getValue();
|
||||
return '?';
|
||||
}
|
||||
|
||||
function show(){
|
||||
if(!$this->argument) return false;
|
||||
$value = $this->argument->getValue();
|
||||
if(!isset($value)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
function getArgument(){
|
||||
return $this->argument;
|
||||
}
|
||||
|
||||
function getArguments()
|
||||
function getValue($with_values = true)
|
||||
{
|
||||
if($with_values)
|
||||
{
|
||||
if ($this->argument)
|
||||
return array($this->argument);
|
||||
else
|
||||
return array();
|
||||
return $this->argument->getValue();
|
||||
}
|
||||
return '?';
|
||||
}
|
||||
|
||||
function show()
|
||||
{
|
||||
if(!$this->argument)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$value = $this->argument->getValue();
|
||||
if(!isset($value))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function getArgument()
|
||||
{
|
||||
return $this->argument;
|
||||
}
|
||||
|
||||
function getArguments()
|
||||
{
|
||||
if($this->argument)
|
||||
{
|
||||
return array($this->argument);
|
||||
}
|
||||
else
|
||||
{
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
}
|
||||
/* End of file InsertExpression.class.php */
|
||||
/* Location: ./classes/db/queryparts/expression/InsertExpression.class.php */
|
||||
|
|
|
|||
|
|
@ -1,59 +1,69 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* SelectExpression
|
||||
* Represents an expresion that appears in the select clause
|
||||
*
|
||||
* $column_name can be:
|
||||
* - a table column name
|
||||
* - an sql function - like count(*)
|
||||
* - an sql expression - substr(column_name, 1, 8) or score1 + score2
|
||||
* $column_name is already escaped
|
||||
*
|
||||
* @author Arnia Software
|
||||
* @package /classes/db/queryparts/expression
|
||||
* @version 0.1
|
||||
*/
|
||||
class SelectExpression extends Expression
|
||||
{
|
||||
|
||||
/**
|
||||
* SelectExpression
|
||||
* Represents an expresion that appears in the select clause
|
||||
*
|
||||
* $column_name can be:
|
||||
* - a table column name
|
||||
* - an sql function - like count(*)
|
||||
* - an sql expression - substr(column_name, 1, 8) or score1 + score2
|
||||
* $column_name is already escaped
|
||||
*
|
||||
* @author Arnia Software
|
||||
* @package /classes/db/queryparts/expression
|
||||
* @version 0.1
|
||||
* column alias name
|
||||
* @var string
|
||||
*/
|
||||
class SelectExpression extends Expression {
|
||||
/**
|
||||
* column alias name
|
||||
* @var string
|
||||
*/
|
||||
var $column_alias;
|
||||
var $column_alias;
|
||||
|
||||
/**
|
||||
* constructor
|
||||
* @param string $column_name
|
||||
* @param string $alias
|
||||
* @return void
|
||||
*/
|
||||
function SelectExpression($column_name, $alias = NULL){
|
||||
parent::Expression($column_name);
|
||||
$this->column_alias = $alias;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return column expression, ex) column as alias
|
||||
* @return string
|
||||
*/
|
||||
function getExpression() {
|
||||
return sprintf("%s%s", $this->column_name, $this->column_alias ? " as ".$this->column_alias : "");
|
||||
}
|
||||
|
||||
function show() {
|
||||
return true;
|
||||
}
|
||||
|
||||
function getArgument(){
|
||||
return null;
|
||||
}
|
||||
|
||||
function getArguments()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
function isSubquery(){
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* constructor
|
||||
* @param string $column_name
|
||||
* @param string $alias
|
||||
* @return void
|
||||
*/
|
||||
function SelectExpression($column_name, $alias = NULL)
|
||||
{
|
||||
parent::Expression($column_name);
|
||||
$this->column_alias = $alias;
|
||||
}
|
||||
?>
|
||||
|
||||
/**
|
||||
* Return column expression, ex) column as alias
|
||||
* @return string
|
||||
*/
|
||||
function getExpression()
|
||||
{
|
||||
return sprintf("%s%s", $this->column_name, $this->column_alias ? " as " . $this->column_alias : "");
|
||||
}
|
||||
|
||||
function show()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
function getArgument()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
function getArguments()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
function isSubquery()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
/* End of file SelectExpression.class.php */
|
||||
/* Location: ./classes/db/queryparts/expression/SelectExpression.class.php */
|
||||
|
|
|
|||
|
|
@ -1,28 +1,36 @@
|
|||
<?php
|
||||
/**
|
||||
* StarExpression
|
||||
* Represents the * in 'select * from ...' statements
|
||||
*
|
||||
* @author Corina
|
||||
* @package /classes/db/queryparts/expression
|
||||
* @version 0.1
|
||||
*/
|
||||
class StarExpression extends SelectExpression {
|
||||
/**
|
||||
* constructor, set the column to asterisk
|
||||
* @return void
|
||||
*/
|
||||
function StarExpression(){
|
||||
parent::SelectExpression("*");
|
||||
}
|
||||
|
||||
function getArgument(){
|
||||
return null;
|
||||
}
|
||||
<?php
|
||||
|
||||
function getArguments(){
|
||||
// StarExpression has no arguments
|
||||
return array();
|
||||
}
|
||||
/**
|
||||
* StarExpression
|
||||
* Represents the * in 'select * from ...' statements
|
||||
*
|
||||
* @author Corina
|
||||
* @package /classes/db/queryparts/expression
|
||||
* @version 0.1
|
||||
*/
|
||||
class StarExpression extends SelectExpression
|
||||
{
|
||||
|
||||
/**
|
||||
* constructor, set the column to asterisk
|
||||
* @return void
|
||||
*/
|
||||
function StarExpression()
|
||||
{
|
||||
parent::SelectExpression("*");
|
||||
}
|
||||
?>
|
||||
|
||||
function getArgument()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
function getArguments()
|
||||
{
|
||||
// StarExpression has no arguments
|
||||
return array();
|
||||
}
|
||||
|
||||
}
|
||||
/* End of file StarExpression.class.php */
|
||||
/* Location: ./classes/db/queryparts/expression/StarExpression.class.php */
|
||||
|
|
|
|||
|
|
@ -1,89 +1,118 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* UpdateExpression
|
||||
*
|
||||
* @author Arnia Software
|
||||
* @package /classes/db/queryparts/expression
|
||||
* @version 0.1
|
||||
*/
|
||||
class UpdateExpression extends Expression
|
||||
{
|
||||
|
||||
/**
|
||||
* UpdateExpression
|
||||
*
|
||||
* @author Arnia Software
|
||||
* @package /classes/db/queryparts/expression
|
||||
* @version 0.1
|
||||
* argument
|
||||
* @var object
|
||||
*/
|
||||
class UpdateExpression extends Expression {
|
||||
/**
|
||||
* argument
|
||||
* @var object
|
||||
*/
|
||||
var $argument;
|
||||
var $argument;
|
||||
|
||||
/**
|
||||
* constructor
|
||||
* @param string $column_name
|
||||
* @param object $argument
|
||||
* @return void
|
||||
*/
|
||||
function UpdateExpression($column_name, $argument){
|
||||
parent::Expression($column_name);
|
||||
$this->argument = $argument;
|
||||
}
|
||||
/**
|
||||
* constructor
|
||||
* @param string $column_name
|
||||
* @param object $argument
|
||||
* @return void
|
||||
*/
|
||||
function UpdateExpression($column_name, $argument)
|
||||
{
|
||||
parent::Expression($column_name);
|
||||
$this->argument = $argument;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return column expression, ex) column = value
|
||||
* @return string
|
||||
*/
|
||||
function getExpression($with_value = true){
|
||||
if($with_value)
|
||||
return $this->getExpressionWithValue();
|
||||
return $this->getExpressionWithoutValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return column expression, ex) column = value
|
||||
* @return string
|
||||
*/
|
||||
function getExpressionWithValue(){
|
||||
$value = $this->argument->getValue();
|
||||
$operation = $this->argument->getColumnOperation();
|
||||
if(isset($operation))
|
||||
return "$this->column_name = $this->column_name $operation $value";
|
||||
return "$this->column_name = $value";
|
||||
}
|
||||
|
||||
/**
|
||||
* Return column expression, ex) column = ?
|
||||
* Can use prepare statement
|
||||
* @return string
|
||||
*/
|
||||
function getExpressionWithoutValue(){
|
||||
$operation = $this->argument->getColumnOperation();
|
||||
if(isset($operation))
|
||||
return "$this->column_name = $this->column_name $operation ?";
|
||||
return "$this->column_name = ?";
|
||||
}
|
||||
|
||||
function getValue(){
|
||||
// TODO Escape value according to column type instead of variable type
|
||||
$value = $this->argument->getValue();
|
||||
if(!is_numeric($value)) return "'".$value."'";
|
||||
return $value;
|
||||
}
|
||||
|
||||
function show(){
|
||||
if(!$this->argument) return false;
|
||||
$value = $this->argument->getValue();
|
||||
if(!isset($value)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
function getArgument(){
|
||||
return $this->argument;
|
||||
}
|
||||
|
||||
function getArguments()
|
||||
/**
|
||||
* Return column expression, ex) column = value
|
||||
* @return string
|
||||
*/
|
||||
function getExpression($with_value = true)
|
||||
{
|
||||
if($with_value)
|
||||
{
|
||||
return $this->getExpressionWithValue();
|
||||
}
|
||||
return $this->getExpressionWithoutValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return column expression, ex) column = value
|
||||
* @return string
|
||||
*/
|
||||
function getExpressionWithValue()
|
||||
{
|
||||
$value = $this->argument->getValue();
|
||||
$operation = $this->argument->getColumnOperation();
|
||||
if(isset($operation))
|
||||
{
|
||||
return "$this->column_name = $this->column_name $operation $value";
|
||||
}
|
||||
return "$this->column_name = $value";
|
||||
}
|
||||
|
||||
/**
|
||||
* Return column expression, ex) column = ?
|
||||
* Can use prepare statement
|
||||
* @return string
|
||||
*/
|
||||
function getExpressionWithoutValue()
|
||||
{
|
||||
$operation = $this->argument->getColumnOperation();
|
||||
if(isset($operation))
|
||||
{
|
||||
return "$this->column_name = $this->column_name $operation ?";
|
||||
}
|
||||
return "$this->column_name = ?";
|
||||
}
|
||||
|
||||
function getValue()
|
||||
{
|
||||
// TODO Escape value according to column type instead of variable type
|
||||
$value = $this->argument->getValue();
|
||||
if(!is_numeric($value))
|
||||
{
|
||||
return "'" . $value . "'";
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
function show()
|
||||
{
|
||||
if(!$this->argument)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$value = $this->argument->getValue();
|
||||
if(!isset($value))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function getArgument()
|
||||
{
|
||||
return $this->argument;
|
||||
}
|
||||
|
||||
function getArguments()
|
||||
{
|
||||
if($this->argument)
|
||||
{
|
||||
if ($this->argument)
|
||||
return array($this->argument);
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
}
|
||||
/* End of file UpdateExpression.class.php */
|
||||
/* Location: ./classes/db/queryparts/expression/UpdateExpression.class.php */
|
||||
|
|
|
|||
|
|
@ -1,55 +1,73 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* UpdateExpression
|
||||
*
|
||||
* @author Arnia Software
|
||||
* @package /classes/db/queryparts/expression
|
||||
* @version 0.1
|
||||
*/
|
||||
class UpdateExpressionWithoutArgument extends UpdateExpression
|
||||
{
|
||||
|
||||
/**
|
||||
* UpdateExpression
|
||||
*
|
||||
* @author Arnia Software
|
||||
* @package /classes/db/queryparts/expression
|
||||
* @version 0.1
|
||||
* argument
|
||||
* @var object
|
||||
*/
|
||||
class UpdateExpressionWithoutArgument extends UpdateExpression {
|
||||
/**
|
||||
* argument
|
||||
* @var object
|
||||
*/
|
||||
var $argument;
|
||||
var $argument;
|
||||
|
||||
/**
|
||||
* constructor
|
||||
* @param string $column_name
|
||||
* @param object $argument
|
||||
* @return void
|
||||
*/
|
||||
function UpdateExpressionWithoutArgument($column_name, $argument){
|
||||
parent::Expression($column_name);
|
||||
$this->argument = $argument;
|
||||
}
|
||||
|
||||
function getExpression($with_value = true){
|
||||
return "$this->column_name = $this->argument";
|
||||
}
|
||||
|
||||
function getValue(){
|
||||
// TODO Escape value according to column type instead of variable type
|
||||
$value = $this->argument;
|
||||
if(!is_numeric($value)) return "'".$value."'";
|
||||
return $value;
|
||||
}
|
||||
|
||||
function show(){
|
||||
if(!$this->argument) return false;
|
||||
$value = $this->argument;
|
||||
if(!isset($value)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
function getArgument(){
|
||||
return null;
|
||||
}
|
||||
|
||||
function getArguments(){
|
||||
return array();
|
||||
}
|
||||
/**
|
||||
* constructor
|
||||
* @param string $column_name
|
||||
* @param object $argument
|
||||
* @return void
|
||||
*/
|
||||
function UpdateExpressionWithoutArgument($column_name, $argument)
|
||||
{
|
||||
parent::Expression($column_name);
|
||||
$this->argument = $argument;
|
||||
}
|
||||
|
||||
function getExpression($with_value = true)
|
||||
{
|
||||
return "$this->column_name = $this->argument";
|
||||
}
|
||||
|
||||
?>
|
||||
function getValue()
|
||||
{
|
||||
// TODO Escape value according to column type instead of variable type
|
||||
$value = $this->argument;
|
||||
if(!is_numeric($value))
|
||||
{
|
||||
return "'" . $value . "'";
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
function show()
|
||||
{
|
||||
if(!$this->argument)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$value = $this->argument;
|
||||
if(!isset($value))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function getArgument()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
function getArguments()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
}
|
||||
/* End of file UpdateExpressionWithoutArgument.class.php */
|
||||
/* Location: ./classes/db/queryparts/expression/UpdateExpressionWithoutArgument.class.php */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue