Commit eb55ec4a authored by zYne's avatar zYne

ported guid() from MDB2

parent e68b193c
...@@ -652,4 +652,13 @@ class Doctrine_Expression extends Doctrine_Connection_Module ...@@ -652,4 +652,13 @@ class Doctrine_Expression extends Doctrine_Connection_Module
$value2 = $this->getIdentifier($value2); $value2 = $this->getIdentifier($value2);
return $expression . ' BETWEEN ' .$value1 . ' AND ' . $value2; return $expression . ' BETWEEN ' .$value1 . ' AND ' . $value2;
} }
/**
* Returns global unique identifier
*
* @return string to get global unique identifier
*/
public function guid()
{
throw new Doctrine_Expression_Exception('method not implemented');
}
} }
...@@ -71,11 +71,19 @@ class Doctrine_Expression_Mssql extends Doctrine_Expression ...@@ -71,11 +71,19 @@ class Doctrine_Expression_Mssql extends Doctrine_Expression
* @param string $arg2 * @param string $arg2
* @param string $values... * @param string $values...
* @return string to concatenate two strings * @return string to concatenate two strings
* @access public */
**/ public function concat($arg1, $arg2)
function concat($arg1, $arg2)
{ {
$args = func_get_args(); $args = func_get_args();
return '(' . implode(' + ', $args) . ')'; return '(' . implode(' + ', $args) . ')';
} }
/**
* Returns global unique identifier
*
* @return string to get global unique identifier
*/
public function guid()
{
return 'NEWID()';
}
} }
...@@ -98,4 +98,13 @@ class Doctrine_Expression_Mysql extends Doctrine_Expression ...@@ -98,4 +98,13 @@ class Doctrine_Expression_Mysql extends Doctrine_Expression
$match.= $this->patternEscapeString(); $match.= $this->patternEscapeString();
return $match; return $match;
} }
/**
* Returns global unique identifier
*
* @return string to get global unique identifier
*/
public function guid()
{
return 'UUID()';
}
} }
...@@ -89,8 +89,17 @@ class Doctrine_Expression_Oracle extends Doctrine_Expression ...@@ -89,8 +89,17 @@ class Doctrine_Expression_Oracle extends Doctrine_Expression
* *
* @return string an oracle SQL string that generates a float between 0 and 1 * @return string an oracle SQL string that generates a float between 0 and 1
*/ */
function random() public function random()
{ {
return 'dbms_random.value'; return 'dbms_random.value';
} }
/**
* Returns global unique identifier
*
* @return string to get global unique identifier
*/
public function guid()
{
return 'SYS_GUID()';
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment