ported guid() from MDB2
This commit is contained in:
parent
e68b193c0a
commit
eb55ec4a5f
@ -652,4 +652,13 @@ class Doctrine_Expression extends Doctrine_Connection_Module
|
||||
$value2 = $this->getIdentifier($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
|
||||
* @param string $arg2
|
||||
* @param string $values...
|
||||
* @return string to concatenate two strings
|
||||
* @access public
|
||||
**/
|
||||
function concat($arg1, $arg2)
|
||||
*/
|
||||
public function concat($arg1, $arg2)
|
||||
{
|
||||
$args = func_get_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
|
||||
$match.= $this->patternEscapeString();
|
||||
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
|
||||
*
|
||||
* @return string an oracle SQL string that generates a float between 0 and 1
|
||||
*/
|
||||
function random()
|
||||
public function random()
|
||||
{
|
||||
return 'dbms_random.value';
|
||||
}
|
||||
/**
|
||||
* Returns global unique identifier
|
||||
*
|
||||
* @return string to get global unique identifier
|
||||
*/
|
||||
public function guid()
|
||||
{
|
||||
return 'SYS_GUID()';
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user