Inherits Doctrine_Expression_Driver.
|
| | __call ($m, $a) |
| |
| | acos ($value) |
| |
| | add (array $args) |
| |
| | avg ($column) |
| |
| | between ($expression, $value1, $value2) |
| |
| | coalesce () |
| |
| | concat () |
| |
| | cos ($value) |
| |
| | count ($column) |
| |
| | div (array $args) |
| |
| | eq ($value1, $value2) |
| |
| | getConnection () |
| |
| | getModuleName () |
| |
| | gt ($value1, $value2) |
| |
| | gte ($value1, $value2) |
| |
| | guid () |
| |
| | in ($column, $values) |
| |
| | isNotNull ($expression) |
| |
| | isNull ($expression) |
| |
| | length ($column) |
| |
| | locate ($str, $substr) |
| |
| | lower ($str) |
| |
| | lt ($value1, $value2) |
| |
| | lte ($value1, $value2) |
| |
| | ltrim ($str) |
| |
| | max ($column) |
| |
| | md5 ($column) |
| |
| | min ($column) |
| |
| | mod ($expression1, $expression2) |
| |
| | mul (array $args) |
| |
| | neq ($value1, $value2) |
| |
| | not ($expression) |
| |
| | now ($type= 'timestamp') |
| |
| | now () |
| |
| | pi () |
| |
| | random () |
| |
| | regexp () |
| |
| | round ($column, $decimals=0) |
| |
| | rtrim ($str) |
| |
| | sin ($value) |
| |
| | soundex ($value) |
| |
| | sub (array $args) |
| |
| | substring ($value, $position, $length=null) |
| |
| | sum ($column) |
| |
| | trim ($str) |
| |
| | upper ($str) |
| |
Definition at line 33 of file Oracle.php.
| Doctrine_Expression_Driver::__call |
( |
|
$m, |
|
|
|
$a |
|
) |
| |
|
inherited |
__call
for all native RDBMS functions the function name itself is returned
Definition at line 639 of file Driver.php.
{
}
return $m . '(' . implode(', ', $a) . ')';
}
| Doctrine_Expression_Driver::acos |
( |
|
$value | ) |
|
|
inherited |
returns arcus cosine SQL string
- Returns
- string
Definition at line 585 of file Driver.php.
{
return 'ACOS(' . $value . ')';
}
| Doctrine_Expression_Driver::add |
( |
array |
$args | ) |
|
|
inherited |
Returns the SQL to add values or expressions together.
add() accepts an arbitrary number of parameters. Each parameter must contain a value or an expression or an array with values or expressions.
- Parameters
-
- Returns
- string an expression
Definition at line 360 of file Driver.php.
{
return $this->basicMath('+', $args);
}
| Doctrine_Expression_Driver::avg |
( |
|
$column | ) |
|
|
inherited |
Returns the average value of a column
- Parameters
-
| string | $column | the column to use |
- Returns
- string generated sql including an AVG aggregate function
Definition at line 62 of file Driver.php.
{
$column = $this->getIdentifier($column);
return 'AVG(' . $column . ')';
}
| Doctrine_Expression_Driver::between |
( |
|
$expression, |
|
|
|
$value1, |
|
|
|
$value2 |
|
) |
| |
|
inherited |
Returns SQL that checks if an expression evaluates to a value between two values.
The parameter $expression is checked if it is between $value1 and $value2.
Note: There is a slight difference in the way BETWEEN works on some databases. http://www.w3schools.com/sql/sql_between.asp. If you want complete database independence you should avoid using between().
- Parameters
-
| string | $expression | the value to compare to |
| string | $value1 | the lower value to compare with |
| string | $value2 | the higher value to compare with |
- Returns
- string logical expression
Definition at line 562 of file Driver.php.
{
$expression = $this->getIdentifier($expression);
$value1 = $this->getIdentifier($value1);
$value2 = $this->getIdentifier($value2);
return $expression . ' BETWEEN ' .$value1 . ' AND ' . $value2;
}
| Doctrine_Expression_Driver::coalesce |
( |
| ) |
|
|
inherited |
coalesce
- Returns
- string
Definition at line 627 of file Driver.php.
{
$args = func_get_args();
return 'COALESCE(' . join(', ', (array) $args) . ')';
}
| Doctrine_Expression_Oracle::concat |
( |
| ) |
|
Returns a series of strings concatinated
concat() accepts an arbitrary number of parameters. Each parameter must contain an expression
- Parameters
-
| string | $arg1,$arg2 | ... $argN strings that will be concatinated. |
- Returns
- string
Definition at line 44 of file Oracle.php.
{
$args = func_get_args();
return join(' || ' , $args);
}
| Doctrine_Expression_Driver::cos |
( |
|
$value | ) |
|
|
inherited |
cos
- Parameters
-
- Returns
- void
Definition at line 617 of file Driver.php.
{
return 'COS(' . $value . ')';
}
| Doctrine_Expression_Driver::count |
( |
|
$column | ) |
|
|
inherited |
Returns the number of rows (without a NULL value) of a column
If a '*' is used instead of a column the number of selected rows is returned.
- Parameters
-
| string | integer | $column | the column to use |
- Returns
- string generated sql including a COUNT aggregate function
Definition at line 77 of file Driver.php.
{
$column = $this->getIdentifier($column);
return 'COUNT(' . $column . ')';
}
| Doctrine_Expression_Driver::div |
( |
array |
$args | ) |
|
|
inherited |
Returns the SQL to divide values or expressions by eachother.
divide() accepts an arbitrary number of parameters. Each parameter must contain a value or an expression or an array with values or expressions.
- Parameters
-
- Returns
- string an expression
Definition at line 405 of file Driver.php.
{
return $this->basicMath('/', $args);
}
| Doctrine_Expression_Driver::eq |
( |
|
$value1, |
|
|
|
$value2 |
|
) |
| |
|
inherited |
Returns the SQL to check if two values are equal.
- Parameters
-
| string | $value1 | logical expression to compare |
| string | $value2 | logical expression to compare with |
- Returns
- string logical expression
Definition at line 417 of file Driver.php.
{
$value1 = $this->getIdentifier($value1);
$value2 = $this->getIdentifier($value2);
return $value1 . ' = ' . $value2;
}
| Doctrine_Connection_Module::getConnection |
( |
| ) |
|
|
inherited |
| Doctrine_Connection_Module::getModuleName |
( |
| ) |
|
|
inherited |
getModuleName returns the name of this module
- Returns
- string the name of this module
Definition at line 79 of file Module.php.
{
return $this->moduleName;
}
| Doctrine_Expression_Driver::gt |
( |
|
$value1, |
|
|
|
$value2 |
|
) |
| |
|
inherited |
Returns the SQL to check if one value is greater than another value.
- Parameters
-
| string | $value1 | logical expression to compare |
| string | $value2 | logical expression to compare with |
- Returns
- string logical expression
Definition at line 445 of file Driver.php.
{
$value1 = $this->getIdentifier($value1);
$value2 = $this->getIdentifier($value2);
return $value1 . ' > ' . $value2;
}
| Doctrine_Expression_Driver::gte |
( |
|
$value1, |
|
|
|
$value2 |
|
) |
| |
|
inherited |
Returns the SQL to check if one value is greater than or equal to another value.
- Parameters
-
| string | $value1 | logical expression to compare |
| string | $value2 | logical expression to compare with |
- Returns
- string logical expression
Definition at line 460 of file Driver.php.
{
$value1 = $this->getIdentifier($value1);
$value2 = $this->getIdentifier($value2);
return $value1 . ' >= ' . $value2;
}
| Doctrine_Expression_Oracle::guid |
( |
| ) |
|
Returns global unique identifier
- Returns
- string to get global unique identifier
Definition at line 104 of file Oracle.php.
| Doctrine_Expression_Driver::in |
( |
|
$column, |
|
|
|
$values |
|
) |
| |
|
inherited |
Returns the SQL to check if a value is one in a set of given values..
in() accepts an arbitrary number of parameters. The first parameter must always specify the value that should be matched against. Successive must contain a logical expression or an array with logical expressions. These expressions will be matched against the first parameter.
- Parameters
-
| string | $column | the value that should be matched against |
| string|array(string) | values that will be matched against $column |
- Returns
- string logical expression
Definition at line 509 of file Driver.php.
{
if ( ! is_array($values)) {
$values = array($values);
}
$values = $this->getIdentifiers($values);
$column = $this->getIdentifier($column);
if (
count($values) == 0) {
}
return $column . ' IN (' . implode(', ', $values) . ')';
}
| Doctrine_Expression_Driver::isNotNull |
( |
|
$expression | ) |
|
|
inherited |
Returns SQL that checks if a expression is not null.
- Parameters
-
| string | $expression | the expression that should be compared to null |
- Returns
- string logical expression
Definition at line 541 of file Driver.php.
{
$expression = $this->getIdentifier($expression);
return $expression . ' IS NOT NULL';
}
| Doctrine_Expression_Driver::isNull |
( |
|
$expression | ) |
|
|
inherited |
Returns SQL that checks if a expression is null.
- Parameters
-
| string | $expression | the expression that should be compared to null |
- Returns
- string logical expression
Definition at line 529 of file Driver.php.
{
$expression = $this->getIdentifier($expression);
return $expression . ' IS NULL';
}
| Doctrine_Expression_Driver::length |
( |
|
$column | ) |
|
|
inherited |
Returns the length of a text field.
- Parameters
-
| string | $expression1 | |
| string | $expression2 | |
- Returns
- string
Definition at line 141 of file Driver.php.
{
$column = $this->getIdentifier($column);
return 'LENGTH(' . $column . ')';
}
| Doctrine_Expression_Driver::locate |
( |
|
$str, |
|
|
|
$substr |
|
) |
| |
|
inherited |
locate returns the position of the first occurrence of substring $substr in string $str
- Parameters
-
| string | $substr | literal string to find |
| string | $str | literal string |
- Returns
- integer
Definition at line 246 of file Driver.php.
{
return 'LOCATE(' . $str . ', ' . $substr . ')';
}
| Doctrine_Expression_Driver::lower |
( |
|
$str | ) |
|
|
inherited |
lower Returns the string $str with all characters changed to lowercase according to the current character set mapping.
- Parameters
-
| string | $str | literal string or column name |
- Returns
- string
Definition at line 233 of file Driver.php.
{
return 'LOWER(' . $str . ')';
}
| Doctrine_Expression_Driver::lt |
( |
|
$value1, |
|
|
|
$value2 |
|
) |
| |
|
inherited |
Returns the SQL to check if one value is less than another value.
- Parameters
-
| string | $value1 | logical expression to compare |
| string | $value2 | logical expression to compare with |
- Returns
- string logical expression
Definition at line 474 of file Driver.php.
{
$value1 = $this->getIdentifier($value1);
$value2 = $this->getIdentifier($value2);
return $value1 . ' < ' . $value2;
}
| Doctrine_Expression_Driver::lte |
( |
|
$value1, |
|
|
|
$value2 |
|
) |
| |
|
inherited |
Returns the SQL to check if one value is less than or equal to another value.
- Parameters
-
| string | $value1 | logical expression to compare |
| string | $value2 | logical expression to compare with |
- Returns
- string logical expression
Definition at line 489 of file Driver.php.
{
$value1 = $this->getIdentifier($value1);
$value2 = $this->getIdentifier($value2);
return $value1 . ' <= ' . $value2;
}
| Doctrine_Expression_Driver::ltrim |
( |
|
$str | ) |
|
|
inherited |
ltrim returns the string $str with leading space characters removed
- Parameters
-
| string | $str | literal string or column name |
- Returns
- string
Definition at line 207 of file Driver.php.
{
return 'LTRIM(' . $str . ')';
}
| Doctrine_Expression_Driver::max |
( |
|
$column | ) |
|
|
inherited |
Returns the highest value of a column
- Parameters
-
| string | $column | the column to use |
- Returns
- string generated sql including a MAX aggregate function
Definition at line 89 of file Driver.php.
{
$column = $this->getIdentifier($column);
return 'MAX(' . $column . ')';
}
| Doctrine_Expression_Driver::md5 |
( |
|
$column | ) |
|
|
inherited |
Returns the md5 sum of a field.
Note: Not SQL92, but common functionality
- Returns
- string
Definition at line 128 of file Driver.php.
{
$column = $this->getIdentifier($column);
return 'MD5(' . $column . ')';
}
| Doctrine_Expression_Driver::min |
( |
|
$column | ) |
|
|
inherited |
Returns the lowest value of a column
- Parameters
-
| string | $column | the column to use |
- Returns
- string
Definition at line 101 of file Driver.php.
{
$column = $this->getIdentifier($column);
return 'MIN(' . $column . ')';
}
| Doctrine_Expression_Driver::mod |
( |
|
$expression1, |
|
|
|
$expression2 |
|
) |
| |
|
inherited |
Returns the remainder of the division operation $expression1 / $expression2.
- Parameters
-
| string | $expression1 | |
| string | $expression2 | |
- Returns
- string
Definition at line 169 of file Driver.php.
{
$expression1 = $this->getIdentifier($expression1);
$expression2 = $this->getIdentifier($expression2);
return 'MOD(' . $expression1 . ', ' . $expression2 . ')';
}
| Doctrine_Expression_Driver::mul |
( |
array |
$args | ) |
|
|
inherited |
Returns the SQL to multiply values or expressions by eachother.
multiply() accepts an arbitrary number of parameters. Each parameter must contain a value or an expression or an array with values or expressions.
- Parameters
-
- Returns
- string an expression
Definition at line 390 of file Driver.php.
{
return $this->basicMath('*', $args);
}
| Doctrine_Expression_Driver::neq |
( |
|
$value1, |
|
|
|
$value2 |
|
) |
| |
|
inherited |
Returns the SQL to check if two values are unequal.
- Parameters
-
| string | $value1 | logical expression to compare |
| string | $value2 | logical expression to compare with |
- Returns
- string logical expression
Definition at line 431 of file Driver.php.
{
$value1 = $this->getIdentifier($value1);
$value2 = $this->getIdentifier($value2);
return $value1 . ' <> ' . $value2;
}
| Doctrine_Expression_Driver::not |
( |
|
$expression | ) |
|
|
inherited |
Returns the SQL for a logical not.
- Returns
- string a logical expression
Definition at line 319 of file Driver.php.
{
$expression = $this->getIdentifier($expression);
return 'NOT(' . $expression . ')';
}
| Doctrine_Expression_Oracle::now |
( |
|
$type = 'timestamp' | ) |
|
Return string to call a variable with the current timestamp inside an SQL statement There are three special variables for current date and time:
- CURRENT_TIMESTAMP (date and time, TIMESTAMP type)
- CURRENT_DATE (date, DATE type)
- CURRENT_TIME (time, TIME type)
- Returns
- string to call a variable with the current timestamp
Definition at line 78 of file Oracle.php.
{
switch ($type) {
case 'date':
case 'time':
case 'timestamp':
default:
return 'TO_CHAR(CURRENT_TIMESTAMP, \'YYYY-MM-DD HH24:MI:SS\')';
}
}
| Doctrine_Expression_Driver::now |
( |
| ) |
|
|
inherited |
Returns the current system date.
- Returns
- string
Definition at line 256 of file Driver.php.
| Doctrine_Expression_Driver::pi |
( |
| ) |
|
|
inherited |
| Doctrine_Expression_Oracle::random |
( |
| ) |
|
random
- Returns
- string an oracle SQL string that generates a float between 0 and 1
Definition at line 94 of file Oracle.php.
{
return 'dbms_random.value';
}
| Doctrine_Expression_Driver::regexp |
( |
| ) |
|
|
inherited |
regexp returns the regular expression operator
- Returns
- string
Definition at line 51 of file Driver.php.
| Doctrine_Expression_Driver::round |
( |
|
$column, |
|
|
|
$decimals = 0 |
|
) |
| |
|
inherited |
Rounds a numeric field to the number of decimals specified.
- Parameters
-
| string | $expression1 | |
| string | $expression2 | |
- Returns
- string
Definition at line 154 of file Driver.php.
{
$column = $this->getIdentifier($column);
return 'ROUND(' . $column . ', ' . $decimals . ')';
}
| Doctrine_Expression_Driver::rtrim |
( |
|
$str | ) |
|
|
inherited |
rtrim returns the string $str with proceeding space characters removed
- Parameters
-
| string | $str | literal string or column name |
- Returns
- string
Definition at line 195 of file Driver.php.
{
return 'RTRIM(' . $str . ')';
}
| Doctrine_Expression_Driver::sin |
( |
|
$value | ) |
|
|
inherited |
sin
- Parameters
-
- Returns
- void
Definition at line 596 of file Driver.php.
{
return 'SIN(' . $value . ')';
}
| Doctrine_Expression_Driver::soundex |
( |
|
$value | ) |
|
|
inherited |
soundex Returns a string to call a function to compute the soundex encoding of a string
The string "?000" is returned if the argument is NULL.
- Parameters
-
- Returns
- string SQL soundex function with given parameter
Definition at line 271 of file Driver.php.
| Doctrine_Expression_Driver::sub |
( |
array |
$args | ) |
|
|
inherited |
Returns the SQL to subtract values or expressions from eachother.
subtract() accepts an arbitrary number of parameters. Each parameter must contain a value or an expression or an array with values or expressions.
- Parameters
-
- Returns
- string an expression
Definition at line 375 of file Driver.php.
{
return $this->basicMath('-', $args );
}
| Doctrine_Expression_Oracle::substring |
( |
|
$value, |
|
|
|
$position, |
|
|
|
$length = null |
|
) |
| |
return string to call a function to get a substring inside an SQL statement
Note: Not SQL92, but common functionality.
- Parameters
-
| string | $value | an sql string literal or column name/alias |
| integer | $position | where to start the substring portion |
| integer | $length | the substring portion length |
- Returns
- string SQL substring function with given parameters
Definition at line 61 of file Oracle.php.
{
if ($length !== null)
return "SUBSTR($value, $position, $length)";
return "SUBSTR($value, $position)";
}
| Doctrine_Expression_Driver::sum |
( |
|
$column | ) |
|
|
inherited |
Returns the total sum of a column
- Parameters
-
| string | $column | the column to use |
- Returns
- string
Definition at line 113 of file Driver.php.
{
$column = $this->getIdentifier($column);
return 'SUM(' . $column . ')';
}
| Doctrine_Expression_Driver::trim |
( |
|
$str | ) |
|
|
inherited |
trim returns the string $str with leading and proceeding space characters removed
- Parameters
-
| string | $str | literal string or column name |
- Returns
- string
Definition at line 183 of file Driver.php.
{
return 'TRIM(' . $str . ')';
}
| Doctrine_Expression_Driver::upper |
( |
|
$str | ) |
|
|
inherited |
upper Returns the string $str with all characters changed to uppercase according to the current character set mapping.
- Parameters
-
| string | $str | literal string or column name |
- Returns
- string
Definition at line 220 of file Driver.php.
{
return 'UPPER(' . $str . ')';
}
The documentation for this class was generated from the following file: