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
7b9474fc
Commit
7b9474fc
authored
Dec 16, 2014
by
Jeroen Thora
Committed by
Steve Müller
Dec 24, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor phpdoc fixes in the platform files
parent
374dbb6e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
34 additions
and
25 deletions
+34
-25
AbstractPlatform.php
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
+13
-11
DB2Platform.php
lib/Doctrine/DBAL/Platforms/DB2Platform.php
+3
-3
DrizzlePlatform.php
lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php
+2
-1
ReservedKeywordsValidator.php
...ine/DBAL/Platforms/Keywords/ReservedKeywordsValidator.php
+1
-0
MySqlPlatform.php
lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
+3
-1
PostgreSqlPlatform.php
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
+4
-2
SQLServerPlatform.php
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
+8
-7
No files found.
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
View file @
7b9474fc
...
@@ -164,7 +164,7 @@ abstract class AbstractPlatform
...
@@ -164,7 +164,7 @@ abstract class AbstractPlatform
/**
/**
* Sets the EventManager used by the Platform.
* Sets the EventManager used by the Platform.
*
*
* @param \Doctrine\Common\EventManager
* @param \Doctrine\Common\EventManager
$eventManager
*/
*/
public
function
setEventManager
(
EventManager
$eventManager
)
public
function
setEventManager
(
EventManager
$eventManager
)
{
{
...
@@ -901,7 +901,7 @@ abstract class AbstractPlatform
...
@@ -901,7 +901,7 @@ abstract class AbstractPlatform
*/
*/
public
function
getConcatExpression
()
public
function
getConcatExpression
()
{
{
return
join
(
' || '
,
func_get_args
());
return
join
(
' || '
,
func_get_args
());
}
}
/**
/**
...
@@ -2253,9 +2253,9 @@ abstract class AbstractPlatform
...
@@ -2253,9 +2253,9 @@ abstract class AbstractPlatform
$default
=
" DEFAULT "
.
$field
[
'default'
];
$default
=
" DEFAULT "
.
$field
[
'default'
];
}
elseif
(
in_array
((
string
)
$field
[
'type'
],
array
(
'DateTime'
,
'DateTimeTz'
))
&&
$field
[
'default'
]
==
$this
->
getCurrentTimestampSQL
())
{
}
elseif
(
in_array
((
string
)
$field
[
'type'
],
array
(
'DateTime'
,
'DateTimeTz'
))
&&
$field
[
'default'
]
==
$this
->
getCurrentTimestampSQL
())
{
$default
=
" DEFAULT "
.
$this
->
getCurrentTimestampSQL
();
$default
=
" DEFAULT "
.
$this
->
getCurrentTimestampSQL
();
}
elseif
((
string
)
$field
[
'type'
]
==
'Time'
&&
$field
[
'default'
]
==
$this
->
getCurrentTimeSQL
())
{
}
elseif
((
string
)
$field
[
'type'
]
==
'Time'
&&
$field
[
'default'
]
==
$this
->
getCurrentTimeSQL
())
{
$default
=
" DEFAULT "
.
$this
->
getCurrentTimeSQL
();
$default
=
" DEFAULT "
.
$this
->
getCurrentTimeSQL
();
}
elseif
((
string
)
$field
[
'type'
]
==
'Date'
&&
$field
[
'default'
]
==
$this
->
getCurrentDateSQL
())
{
}
elseif
((
string
)
$field
[
'type'
]
==
'Date'
&&
$field
[
'default'
]
==
$this
->
getCurrentDateSQL
())
{
$default
=
" DEFAULT "
.
$this
->
getCurrentDateSQL
();
$default
=
" DEFAULT "
.
$this
->
getCurrentDateSQL
();
}
elseif
((
string
)
$field
[
'type'
]
==
'Boolean'
)
{
}
elseif
((
string
)
$field
[
'type'
]
==
'Boolean'
)
{
$default
=
" DEFAULT '"
.
$this
->
convertBooleans
(
$field
[
'default'
])
.
"'"
;
$default
=
" DEFAULT '"
.
$this
->
convertBooleans
(
$field
[
'default'
])
.
"'"
;
...
@@ -2298,8 +2298,8 @@ abstract class AbstractPlatform
...
@@ -2298,8 +2298,8 @@ abstract class AbstractPlatform
* Obtains DBMS specific SQL code portion needed to set a unique
* Obtains DBMS specific SQL code portion needed to set a unique
* constraint declaration to be used in statements like CREATE TABLE.
* constraint declaration to be used in statements like CREATE TABLE.
*
*
* @param string
$name The name of the unique constraint.
* @param string $name The name of the unique constraint.
* @param \Doctrine\DBAL\Schema\Index
$index The index definition.
* @param \Doctrine\DBAL\Schema\Index $index The index definition.
*
*
* @return string DBMS specific SQL code portion needed to set a constraint.
* @return string DBMS specific SQL code portion needed to set a constraint.
*
*
...
@@ -2323,8 +2323,8 @@ abstract class AbstractPlatform
...
@@ -2323,8 +2323,8 @@ abstract class AbstractPlatform
* Obtains DBMS specific SQL code portion needed to set an index
* Obtains DBMS specific SQL code portion needed to set an index
* declaration to be used in statements like CREATE TABLE.
* declaration to be used in statements like CREATE TABLE.
*
*
* @param string
$name The name of the index.
* @param string $name The name of the index.
* @param \Doctrine\DBAL\Schema\Index
$index The index definition.
* @param \Doctrine\DBAL\Schema\Index $index The index definition.
*
*
* @return string DBMS specific SQL code portion needed to set an index.
* @return string DBMS specific SQL code portion needed to set an index.
*
*
...
@@ -2583,6 +2583,7 @@ abstract class AbstractPlatform
...
@@ -2583,6 +2583,7 @@ abstract class AbstractPlatform
* This method should handle the literal case
* This method should handle the literal case
*
*
* @param mixed $item A boolean or an array of them.
* @param mixed $item A boolean or an array of them.
*
* @return mixed A boolean database value or an array of them.
* @return mixed A boolean database value or an array of them.
*/
*/
public
function
convertBooleans
(
$item
)
public
function
convertBooleans
(
$item
)
...
@@ -2621,6 +2622,7 @@ abstract class AbstractPlatform
...
@@ -2621,6 +2622,7 @@ abstract class AbstractPlatform
* Note: if the input is not a boolean the original input might be returned.
* Note: if the input is not a boolean the original input might be returned.
*
*
* @param mixed $item A boolean or an array of them.
* @param mixed $item A boolean or an array of them.
*
* @return mixed A boolean database value or an array of them.
* @return mixed A boolean database value or an array of them.
*/
*/
public
function
convertBooleansToDatabaseValue
(
$item
)
public
function
convertBooleansToDatabaseValue
(
$item
)
...
@@ -3300,11 +3302,11 @@ abstract class AbstractPlatform
...
@@ -3300,11 +3302,11 @@ abstract class AbstractPlatform
final
public
function
modifyLimitQuery
(
$query
,
$limit
,
$offset
=
null
)
final
public
function
modifyLimitQuery
(
$query
,
$limit
,
$offset
=
null
)
{
{
if
(
$limit
!==
null
)
{
if
(
$limit
!==
null
)
{
$limit
=
(
int
)
$limit
;
$limit
=
(
int
)
$limit
;
}
}
if
(
$offset
!==
null
)
{
if
(
$offset
!==
null
)
{
$offset
=
(
int
)
$offset
;
$offset
=
(
int
)
$offset
;
if
(
$offset
<
0
)
{
if
(
$offset
<
0
)
{
throw
new
DBALException
(
"LIMIT argument offset=
$offset
is not valid"
);
throw
new
DBALException
(
"LIMIT argument offset=
$offset
is not valid"
);
...
@@ -3320,7 +3322,7 @@ abstract class AbstractPlatform
...
@@ -3320,7 +3322,7 @@ abstract class AbstractPlatform
/**
/**
* Adds an driver-specific LIMIT clause to the query.
* Adds an driver-specific LIMIT clause to the query.
*
*
* @param string $query
* @param string
$query
* @param integer|null $limit
* @param integer|null $limit
* @param integer|null $offset
* @param integer|null $offset
*
*
...
...
lib/Doctrine/DBAL/Platforms/DB2Platform.php
View file @
7b9474fc
...
@@ -703,7 +703,7 @@ class DB2Platform extends AbstractPlatform
...
@@ -703,7 +703,7 @@ class DB2Platform extends AbstractPlatform
}
}
if
(
isset
(
$field
[
'version'
])
&&
$field
[
'version'
])
{
if
(
isset
(
$field
[
'version'
])
&&
$field
[
'version'
])
{
if
((
string
)
$field
[
'type'
]
!=
"DateTime"
)
{
if
((
string
)
$field
[
'type'
]
!=
"DateTime"
)
{
$field
[
'default'
]
=
"1"
;
$field
[
'default'
]
=
"1"
;
}
}
}
}
...
@@ -744,8 +744,8 @@ class DB2Platform extends AbstractPlatform
...
@@ -744,8 +744,8 @@ class DB2Platform extends AbstractPlatform
return
$query
;
return
$query
;
}
}
$limit
=
(
int
)
$limit
;
$limit
=
(
int
)
$limit
;
$offset
=
(
int
)((
$offset
)
?:
0
);
$offset
=
(
int
)
((
$offset
)
?:
0
);
// Todo OVER() needs ORDER BY data!
// Todo OVER() needs ORDER BY data!
$sql
=
'SELECT db22.* FROM (SELECT ROW_NUMBER() OVER() AS DC_ROWNUM, db21.* '
.
$sql
=
'SELECT db22.* FROM (SELECT ROW_NUMBER() OVER() AS DC_ROWNUM, db21.* '
.
...
...
lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php
View file @
7b9474fc
...
@@ -101,6 +101,7 @@ class DrizzlePlatform extends AbstractPlatform
...
@@ -101,6 +101,7 @@ class DrizzlePlatform extends AbstractPlatform
if
(
!
empty
(
$columnDef
[
'autoincrement'
]))
{
if
(
!
empty
(
$columnDef
[
'autoincrement'
]))
{
$autoinc
=
' AUTO_INCREMENT'
;
$autoinc
=
' AUTO_INCREMENT'
;
}
}
return
$autoinc
;
return
$autoinc
;
}
}
...
@@ -205,7 +206,7 @@ class DrizzlePlatform extends AbstractPlatform
...
@@ -205,7 +206,7 @@ class DrizzlePlatform extends AbstractPlatform
// add all indexes
// add all indexes
if
(
isset
(
$options
[
'indexes'
])
&&
!
empty
(
$options
[
'indexes'
]))
{
if
(
isset
(
$options
[
'indexes'
])
&&
!
empty
(
$options
[
'indexes'
]))
{
foreach
(
$options
[
'indexes'
]
as
$index
=>
$definition
)
{
foreach
(
$options
[
'indexes'
]
as
$index
=>
$definition
)
{
$queryFields
.=
', '
.
$this
->
getIndexDeclarationSQL
(
$index
,
$definition
);
$queryFields
.=
', '
.
$this
->
getIndexDeclarationSQL
(
$index
,
$definition
);
}
}
}
}
...
...
lib/Doctrine/DBAL/Platforms/Keywords/ReservedKeywordsValidator.php
View file @
7b9474fc
...
@@ -72,6 +72,7 @@ class ReservedKeywordsValidator implements Visitor
...
@@ -72,6 +72,7 @@ class ReservedKeywordsValidator implements Visitor
$keywordLists
[]
=
$keywordList
->
getName
();
$keywordLists
[]
=
$keywordList
->
getName
();
}
}
}
}
return
$keywordLists
;
return
$keywordLists
;
}
}
...
...
lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
View file @
7b9474fc
...
@@ -106,6 +106,7 @@ class MySqlPlatform extends AbstractPlatform
...
@@ -106,6 +106,7 @@ class MySqlPlatform extends AbstractPlatform
public
function
getConcatExpression
()
public
function
getConcatExpression
()
{
{
$args
=
func_get_args
();
$args
=
func_get_args
();
return
'CONCAT('
.
join
(
', '
,
(
array
)
$args
)
.
')'
;
return
'CONCAT('
.
join
(
', '
,
(
array
)
$args
)
.
')'
;
}
}
...
@@ -298,7 +299,7 @@ class MySqlPlatform extends AbstractPlatform
...
@@ -298,7 +299,7 @@ class MySqlPlatform extends AbstractPlatform
*
*
* @deprecated Deprecated since version 2.5, Use {@link self::getColumnCollationDeclarationSQL()} instead.
* @deprecated Deprecated since version 2.5, Use {@link self::getColumnCollationDeclarationSQL()} instead.
*
*
* @param string $collation
name of the collation
* @param string $collation name of the collation
*
*
* @return string DBMS specific SQL code portion needed to set the COLLATION
* @return string DBMS specific SQL code portion needed to set the COLLATION
* of a field declaration.
* of a field declaration.
...
@@ -736,6 +737,7 @@ class MySqlPlatform extends AbstractPlatform
...
@@ -736,6 +737,7 @@ class MySqlPlatform extends AbstractPlatform
$query
.=
' MATCH '
.
$foreignKey
->
getOption
(
'match'
);
$query
.=
' MATCH '
.
$foreignKey
->
getOption
(
'match'
);
}
}
$query
.=
parent
::
getAdvancedForeignKeyOptionsSQL
(
$foreignKey
);
$query
.=
parent
::
getAdvancedForeignKeyOptionsSQL
(
$foreignKey
);
return
$query
;
return
$query
;
}
}
...
...
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
View file @
7b9474fc
...
@@ -76,7 +76,7 @@ class PostgreSqlPlatform extends AbstractPlatform
...
@@ -76,7 +76,7 @@ class PostgreSqlPlatform extends AbstractPlatform
*/
*/
public
function
setUseBooleanTrueFalseStrings
(
$flag
)
public
function
setUseBooleanTrueFalseStrings
(
$flag
)
{
{
$this
->
useBooleanTrueFalseStrings
=
(
bool
)
$flag
;
$this
->
useBooleanTrueFalseStrings
=
(
bool
)
$flag
;
}
}
/**
/**
...
@@ -694,6 +694,7 @@ class PostgreSqlPlatform extends AbstractPlatform
...
@@ -694,6 +694,7 @@ class PostgreSqlPlatform extends AbstractPlatform
if
(
$sequence
instanceof
Sequence
)
{
if
(
$sequence
instanceof
Sequence
)
{
$sequence
=
$sequence
->
getQuotedName
(
$this
);
$sequence
=
$sequence
->
getQuotedName
(
$this
);
}
}
return
'DROP SEQUENCE '
.
$sequence
.
' CASCADE'
;
return
'DROP SEQUENCE '
.
$sequence
.
' CASCADE'
;
}
}
...
@@ -792,7 +793,7 @@ class PostgreSqlPlatform extends AbstractPlatform
...
@@ -792,7 +793,7 @@ class PostgreSqlPlatform extends AbstractPlatform
* and passes them to the given callback function to be reconverted
* and passes them to the given callback function to be reconverted
* into any custom representation.
* into any custom representation.
*
*
* @param mixed
$item
The value(s) to convert.
* @param mixed
$item
The value(s) to convert.
* @param callable $callback The callback function to use for converting the real boolean value(s).
* @param callable $callback The callback function to use for converting the real boolean value(s).
*
*
* @return mixed
* @return mixed
...
@@ -907,6 +908,7 @@ class PostgreSqlPlatform extends AbstractPlatform
...
@@ -907,6 +908,7 @@ class PostgreSqlPlatform extends AbstractPlatform
if
(
!
empty
(
$field
[
'autoincrement'
]))
{
if
(
!
empty
(
$field
[
'autoincrement'
]))
{
return
'BIGSERIAL'
;
return
'BIGSERIAL'
;
}
}
return
'BIGINT'
;
return
'BIGINT'
;
}
}
...
...
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
View file @
7b9474fc
...
@@ -272,6 +272,7 @@ class SQLServerPlatform extends AbstractPlatform
...
@@ -272,6 +272,7 @@ class SQLServerPlatform extends AbstractPlatform
if
(
$index
->
hasFlag
(
'nonclustered'
))
{
if
(
$index
->
hasFlag
(
'nonclustered'
))
{
$flags
=
' NONCLUSTERED'
;
$flags
=
' NONCLUSTERED'
;
}
}
return
'ALTER TABLE '
.
$table
.
' ADD PRIMARY KEY'
.
$flags
.
' ('
.
$this
->
getIndexFieldDeclarationListSQL
(
$index
->
getQuotedColumns
(
$this
))
.
')'
;
return
'ALTER TABLE '
.
$table
.
' ADD PRIMARY KEY'
.
$flags
.
' ('
.
$this
->
getIndexFieldDeclarationListSQL
(
$index
->
getQuotedColumns
(
$this
))
.
')'
;
}
}
...
@@ -560,8 +561,8 @@ class SQLServerPlatform extends AbstractPlatform
...
@@ -560,8 +561,8 @@ class SQLServerPlatform extends AbstractPlatform
/**
/**
* Returns the SQL clause for adding a default constraint in an ALTER TABLE statement.
* Returns the SQL clause for adding a default constraint in an ALTER TABLE statement.
*
*
* @param
string $tableName The name of the table to generate the clause for.
* @param string $tableName The name of the table to generate the clause for.
* @param
Column $column The column to generate the clause for.
* @param Column $column The column to generate the clause for.
*
*
* @return string
* @return string
*/
*/
...
@@ -576,8 +577,8 @@ class SQLServerPlatform extends AbstractPlatform
...
@@ -576,8 +577,8 @@ class SQLServerPlatform extends AbstractPlatform
/**
/**
* Returns the SQL clause for dropping an existing default constraint in an ALTER TABLE statement.
* Returns the SQL clause for dropping an existing default constraint in an ALTER TABLE statement.
*
*
* @param
string $tableName The name of the table to generate the clause for.
* @param string $tableName The name of the table to generate the clause for.
* @param
string $columnName The name of the column to generate the clause for.
* @param string $columnName The name of the column to generate the clause for.
*
*
* @return string
* @return string
*/
*/
...
@@ -594,7 +595,7 @@ class SQLServerPlatform extends AbstractPlatform
...
@@ -594,7 +595,7 @@ class SQLServerPlatform extends AbstractPlatform
* in a column's type require dropping the default constraint first before being to
* in a column's type require dropping the default constraint first before being to
* alter the particular column to the new definition.
* alter the particular column to the new definition.
*
*
* @param
ColumnDiff $columnDiff The column diff to evaluate.
* @param ColumnDiff $columnDiff The column diff to evaluate.
*
*
* @return boolean True if the column alteration requires dropping its default constraint first, false otherwise.
* @return boolean True if the column alteration requires dropping its default constraint first, false otherwise.
*/
*/
...
@@ -915,8 +916,8 @@ class SQLServerPlatform extends AbstractPlatform
...
@@ -915,8 +916,8 @@ class SQLServerPlatform extends AbstractPlatform
* Returns the where clause to filter schema and table name in a query.
* Returns the where clause to filter schema and table name in a query.
*
*
* @param string $table The full qualified name of the table.
* @param string $table The full qualified name of the table.
* @param string $
tableColumn
The name of the column to compare the schema to in the where clause.
* @param string $
schemaColumn
The name of the column to compare the schema to in the where clause.
* @param string $
schemaColumn
The name of the column to compare the table to in the where clause.
* @param string $
tableColumn
The name of the column to compare the table to in the where clause.
*
*
* @return string
* @return string
*/
*/
...
...
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