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
0ceb3479
Commit
0ceb3479
authored
Jan 30, 2013
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #258 from pkruithof/master
Guid type requires SQL typehint comment
parents
853b9653
1f972085
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
1 deletion
+43
-1
AbstractPlatform.php
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
+10
-0
PostgreSqlPlatform.php
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
+8
-0
SQLServerPlatform.php
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
+8
-0
GuidType.php
lib/Doctrine/DBAL/Types/GuidType.php
+5
-0
GuidTypeTest.php
tests/Doctrine/Tests/DBAL/Types/GuidTypeTest.php
+12
-1
No files found.
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
View file @
0ceb3479
...
...
@@ -2573,6 +2573,16 @@ abstract class AbstractPlatform
return
false
;
}
/**
* Does this platform have native guid type.
*
* @return boolean
*/
public
function
hasNativeGuidType
()
{
return
false
;
}
public
function
getIdentityColumnNullInsertSQL
()
{
return
""
;
...
...
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
View file @
0ceb3479
...
...
@@ -155,6 +155,14 @@ class PostgreSqlPlatform extends AbstractPlatform
return
true
;
}
/**
* {@inheritDoc}
*/
public
function
hasNativeGuidType
()
{
return
true
;
}
public
function
getListDatabasesSQL
()
{
return
'SELECT datname FROM pg_database'
;
...
...
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
View file @
0ceb3479
...
...
@@ -106,6 +106,14 @@ class SQLServerPlatform extends AbstractPlatform
return
false
;
}
/**
* {@inheritDoc}
*/
public
function
hasNativeGuidType
()
{
return
true
;
}
/**
* {@inheritDoc}
*/
...
...
lib/Doctrine/DBAL/Types/GuidType.php
View file @
0ceb3479
...
...
@@ -38,5 +38,10 @@ class GuidType extends StringType
{
return
Type
::
GUID
;
}
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
{
return
!
$platform
->
hasNativeGuidType
();
}
}
tests/Doctrine/Tests/DBAL/Types/GuidTypeTest.php
View file @
0ceb3479
...
...
@@ -27,5 +27,16 @@ class GuidTest extends \Doctrine\Tests\DbalTestCase
{
$this
->
assertNull
(
$this
->
_type
->
convertToPHPValue
(
null
,
$this
->
_platform
));
}
}
public
function
testNativeGuidSupport
()
{
$this
->
assertTrue
(
$this
->
_type
->
requiresSQLCommentHint
(
$this
->
_platform
));
$mock
=
$this
->
getMock
(
get_class
(
$this
->
_platform
));
$mock
->
expects
(
$this
->
any
())
->
method
(
'hasNativeGuidType'
)
->
will
(
$this
->
returnValue
(
true
));
$this
->
assertFalse
(
$this
->
_type
->
requiresSQLCommentHint
(
$mock
));
}
}
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