1
0
mirror of synced 2024-12-13 22:56:04 +03:00

ported guid() from MDB2

This commit is contained in:
zYne 2007-03-07 10:38:45 +00:00
parent e68b193c0a
commit eb55ec4a5f
4 changed files with 39 additions and 4 deletions

View File

@ -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');
}
}

View File

@ -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()';
}
}

View File

@ -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()';
}
}

View File

@ -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()';
}
}