Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
6f5cf403
Commit
6f5cf403
authored
Jan 10, 2008
by
lsmith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- default to sql standard concat syntax instead of mysql's non standard variant
parent
442fb477
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
57 deletions
+19
-57
Driver.php
lib/Doctrine/Expression/Driver.php
+8
-7
Mysql.php
lib/Doctrine/Expression/Mysql.php
+9
-8
Oracle.php
lib/Doctrine/Expression/Oracle.php
+1
-17
Pgsql.php
lib/Doctrine/Expression/Pgsql.php
+1
-25
No files found.
lib/Doctrine/Expression/Driver.php
View file @
6f5cf403
...
...
@@ -299,15 +299,16 @@ class Doctrine_Expression_Driver extends Doctrine_Connection_Module
* Returns a series of strings concatinated
*
* concat() accepts an arbitrary number of parameters. Each parameter
* must contain an expression
or an array with expressions.
* must contain an expression
*
* @param string|array(string) strings that will be concatinated.
* @param string $arg1, $arg2 ... $argN strings that will be concatinated.
* @return string
*/
public
function
concat
()
{
$args
=
func_get_args
();
return
'CONCAT('
.
join
(
', '
,
(
array
)
$args
)
.
')'
;
return
join
(
' || '
,
$args
)
;
}
/**
...
...
lib/Doctrine/Expression/Mysql.php
View file @
6f5cf403
...
...
@@ -112,16 +112,17 @@ class Doctrine_Expression_Mysql extends Doctrine_Expression_Driver
}
/**
* Returns
string to concatenate two or more string parameters
* Returns
a series of strings concatinated
*
*
@param string $value1
*
@param string $value2
*
@param string $values...
* @
return string to concatenate two strings
*
*
/
function
concat
(
$value1
,
$value2
)
*
concat() accepts an arbitrary number of parameters. Each parameter
*
must contain an expression or an array with expressions.
*
* @
param string|array(string) strings that will be concatinated.
*/
public
function
concat
(
)
{
$args
=
func_get_args
();
return
'CONCAT('
.
implode
(
', '
,
$args
)
.
')'
;
return
'CONCAT('
.
join
(
', '
,
(
array
)
$args
)
.
')'
;
}
}
lib/Doctrine/Expression/Oracle.php
View file @
6f5cf403
...
...
@@ -32,22 +32,6 @@ Doctrine::autoload('Doctrine_Expression_Driver');
*/
class
Doctrine_Expression_Oracle
extends
Doctrine_Expression_Driver
{
/**
* Returns a series of strings concatinated
*
* concat() accepts an arbitrary number of parameters. Each parameter
* must contain an expression
*
* @param string $arg1, $arg2 ... $argN strings that will be concatinated.
* @return string
*/
public
function
concat
()
{
$args
=
func_get_args
();
return
join
(
' || '
,
$args
);
}
/**
* return string to call a function to get a substring inside an SQL statement
*
...
...
lib/Doctrine/Expression/Pgsql.php
View file @
6f5cf403
...
...
@@ -83,17 +83,6 @@ class Doctrine_Expression_Pgsql extends Doctrine_Expression_Driver
}
}
/**
* Returns a series of strings concatinated
*
* concat() accepts an arbitrary number of parameters. Each parameter
* must contain an expression or an array with expressions.
*
* @param string|array(string) strings that will be concatinated.
* @return string
*/
/**
* PostgreSQLs AGE(<timestamp1> [, <timestamp2>]) function.
*
...
...
@@ -131,19 +120,6 @@ class Doctrine_Expression_Pgsql extends Doctrine_Expression_Driver
return
'TO_CHAR('
.
$time
.
', '
.
$text
.
')'
;
}
/**
* PostgreSQLs CONCAT() function
*
* @param an array of values
* @return string
*/
public
function
concat
()
{
$args
=
func_get_args
();
return
join
(
' || '
,
$args
);
}
/**
* Returns the SQL string to return the current system date and time.
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment