lib/Doctrine/DBAL/Platforms/AbstractPlatform.php 1 location
|
@@ 892-899 (lines=8) @@
|
| 889 |
|
* |
| 890 |
|
* @return string |
| 891 |
|
*/ |
| 892 |
|
public function getSubstringExpression($value, $from, $length = null) |
| 893 |
|
{ |
| 894 |
|
if ($length === null) { |
| 895 |
|
return 'SUBSTRING(' . $value . ' FROM ' . $from . ')'; |
| 896 |
|
} |
| 897 |
|
|
| 898 |
|
return 'SUBSTRING(' . $value . ' FROM ' . $from . ' FOR ' . $length . ')'; |
| 899 |
|
} |
| 900 |
|
|
| 901 |
|
/** |
| 902 |
|
* Returns a SQL snippet to concatenate the given expressions. |
lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php 1 location
|
@@ 1070-1077 (lines=8) @@
|
| 1067 |
|
/** |
| 1068 |
|
* {@inheritdoc} |
| 1069 |
|
*/ |
| 1070 |
|
public function getSubstringExpression($value, $from, $length = null) |
| 1071 |
|
{ |
| 1072 |
|
if (null === $length) { |
| 1073 |
|
return 'SUBSTRING(' . $value . ', ' . $from . ')'; |
| 1074 |
|
} |
| 1075 |
|
|
| 1076 |
|
return 'SUBSTRING(' . $value . ', ' . $from . ', ' . $length . ')'; |
| 1077 |
|
} |
| 1078 |
|
|
| 1079 |
|
/** |
| 1080 |
|
* {@inheritdoc} |
lib/Doctrine/DBAL/Platforms/SqlitePlatform.php 1 location
|
@@ 107-114 (lines=8) @@
|
| 104 |
|
* |
| 105 |
|
* SQLite only supports the 2 parameter variant of this function |
| 106 |
|
*/ |
| 107 |
|
public function getSubstringExpression($value, $position, $length = null) |
| 108 |
|
{ |
| 109 |
|
if ($length !== null) { |
| 110 |
|
return 'SUBSTR(' . $value . ', ' . $position . ', ' . $length . ')'; |
| 111 |
|
} |
| 112 |
|
|
| 113 |
|
return 'SUBSTR(' . $value . ', ' . $position . ', LENGTH(' . $value . '))'; |
| 114 |
|
} |
| 115 |
|
|
| 116 |
|
/** |
| 117 |
|
* {@inheritDoc} |
lib/Doctrine/DBAL/Platforms/DB2Platform.php 1 location
|
@@ 810-817 (lines=8) @@
|
| 807 |
|
/** |
| 808 |
|
* {@inheritDoc} |
| 809 |
|
*/ |
| 810 |
|
public function getSubstringExpression($value, $from, $length = null) |
| 811 |
|
{ |
| 812 |
|
if ($length === null) { |
| 813 |
|
return 'SUBSTR(' . $value . ', ' . $from . ')'; |
| 814 |
|
} |
| 815 |
|
|
| 816 |
|
return 'SUBSTR(' . $value . ', ' . $from . ', ' . $length . ')'; |
| 817 |
|
} |
| 818 |
|
|
| 819 |
|
/** |
| 820 |
|
* {@inheritDoc} |
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php 1 location
|
@@ 88-95 (lines=8) @@
|
| 85 |
|
/** |
| 86 |
|
* {@inheritDoc} |
| 87 |
|
*/ |
| 88 |
|
public function getSubstringExpression($value, $from, $length = null) |
| 89 |
|
{ |
| 90 |
|
if ($length === null) { |
| 91 |
|
return 'SUBSTRING(' . $value . ' FROM ' . $from . ')'; |
| 92 |
|
} |
| 93 |
|
|
| 94 |
|
return 'SUBSTRING(' . $value . ' FROM ' . $from . ' FOR ' . $length . ')'; |
| 95 |
|
} |
| 96 |
|
|
| 97 |
|
/** |
| 98 |
|
* {@inheritDoc} |