mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-26 14:49:56 +09:00
adds comments for phpDoc
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10739 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
94be154d88
commit
c65e9d3071
29 changed files with 1701 additions and 583 deletions
|
|
@ -1,15 +1,24 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @class ClickCountExpression
|
||||
* ClickCountExpression
|
||||
* @author Arnia Software
|
||||
* @brief
|
||||
*
|
||||
* @package /classes/db/queryparts/expression
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
class ClickCountExpression extends SelectExpression {
|
||||
/**
|
||||
* click count
|
||||
* @var boolean
|
||||
*/
|
||||
var $click_count;
|
||||
|
||||
/**
|
||||
* constructor
|
||||
* @param string $column_name
|
||||
* @param string $alias
|
||||
* @param boolean $click_count
|
||||
* @return void
|
||||
*/
|
||||
function ClickCountExpression($column_name, $alias = NULL, $click_count = false){
|
||||
parent::SelectExpression($column_name, $alias);
|
||||
|
||||
|
|
@ -25,9 +34,13 @@
|
|||
return $this->click_count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return column expression, ex) column = column + 1
|
||||
* @return string
|
||||
*/
|
||||
function getExpression(){
|
||||
return "$this->column_name = $this->column_name + 1";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,20 +1,35 @@
|
|||
<?php
|
||||
/**
|
||||
* @class DeleteExpression
|
||||
* @author Arnia Software
|
||||
* @brief
|
||||
* DeleteExpression
|
||||
*
|
||||
* @author Arnia Software
|
||||
* @package /classes/db/queryparts/expression
|
||||
* @version 0.1
|
||||
* @todo Fix this class
|
||||
*/
|
||||
|
||||
// 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";
|
||||
}
|
||||
|
|
@ -32,4 +47,4 @@
|
|||
}
|
||||
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,18 +1,28 @@
|
|||
<?php
|
||||
/**
|
||||
* @class Expression
|
||||
* @author Corina
|
||||
* @brief Represents an expression used in select/update/insert/delete statements
|
||||
* 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 {
|
||||
/**
|
||||
* column name
|
||||
* @var string
|
||||
*/
|
||||
var $column_name;
|
||||
|
||||
/**
|
||||
* constructor
|
||||
* @param string $column_name
|
||||
* @return void
|
||||
*/
|
||||
function Expression($column_name){
|
||||
$this->column_name = $column_name;
|
||||
}
|
||||
|
|
@ -25,6 +35,10 @@
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return column expression, ex) column as alias
|
||||
* @return string
|
||||
*/
|
||||
function getExpression() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,24 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @class InsertExpression
|
||||
* @author Arnia Software
|
||||
* @brief
|
||||
* InsertExpression
|
||||
*
|
||||
* @author Arnia Software
|
||||
* @package /classes/db/queryparts/expression
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
class InsertExpression extends Expression {
|
||||
/**
|
||||
* argument
|
||||
* @var object
|
||||
*/
|
||||
var $argument;
|
||||
|
||||
/**
|
||||
* constructor
|
||||
* @param string $column_name
|
||||
* @param object $argument
|
||||
* @return void
|
||||
*/
|
||||
function InsertExpression($column_name, $argument){
|
||||
parent::Expression($column_name);
|
||||
$this->argument = $argument;
|
||||
|
|
|
|||
|
|
@ -1,26 +1,40 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @class SelectExpression
|
||||
* @author Arnia Software
|
||||
* @brief Represents an expresion that appears in the select clause
|
||||
* SelectExpression
|
||||
* Represents an expresion that appears in the select clause
|
||||
*
|
||||
* @remarks
|
||||
* $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 {
|
||||
/**
|
||||
* column alias name
|
||||
* @var string
|
||||
*/
|
||||
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 : "");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,17 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @class StarExpression
|
||||
* @author Corina
|
||||
* @brief Represents the * in 'select * from ...' statements
|
||||
* 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("*");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,25 +1,43 @@
|
|||
<?php
|
||||
/**
|
||||
* @class UpdateExpression
|
||||
* @author Arnia Software
|
||||
* @brief
|
||||
* UpdateExpression
|
||||
*
|
||||
* @author Arnia Software
|
||||
* @package /classes/db/queryparts/expression
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
class UpdateExpression extends Expression {
|
||||
/**
|
||||
* argument
|
||||
* @var object
|
||||
*/
|
||||
var $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();
|
||||
|
|
@ -28,6 +46,11 @@
|
|||
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))
|
||||
|
|
|
|||
|
|
@ -1,14 +1,24 @@
|
|||
<?php
|
||||
/**
|
||||
* @class UpdateExpression
|
||||
* @author Arnia Software
|
||||
* @brief
|
||||
* UpdateExpression
|
||||
*
|
||||
* @author Arnia Software
|
||||
* @package /classes/db/queryparts/expression
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
class UpdateExpressionWithoutArgument extends UpdateExpression {
|
||||
/**
|
||||
* argument
|
||||
* @var object
|
||||
*/
|
||||
var $argument;
|
||||
|
||||
/**
|
||||
* constructor
|
||||
* @param string $column_name
|
||||
* @param object $argument
|
||||
* @return void
|
||||
*/
|
||||
function UpdateExpressionWithoutArgument($column_name, $argument){
|
||||
parent::Expression($column_name);
|
||||
$this->argument = $argument;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue