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
1f972085
Commit
1f972085
authored
Jan 27, 2013
by
Peter Kruithof
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Type hinting for guid type now depends on platform's native guid support
parent
d6dba15f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
2 deletions
+39
-2
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
+1
-1
GuidTypeTest.php
tests/Doctrine/Tests/DBAL/Types/GuidTypeTest.php
+12
-1
No files found.
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
View file @
1f972085
...
@@ -2573,6 +2573,16 @@ abstract class AbstractPlatform
...
@@ -2573,6 +2573,16 @@ abstract class AbstractPlatform
return
false
;
return
false
;
}
}
/**
* Does this platform have native guid type.
*
* @return boolean
*/
public
function
hasNativeGuidType
()
{
return
false
;
}
public
function
getIdentityColumnNullInsertSQL
()
public
function
getIdentityColumnNullInsertSQL
()
{
{
return
""
;
return
""
;
...
...
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
View file @
1f972085
...
@@ -155,6 +155,14 @@ class PostgreSqlPlatform extends AbstractPlatform
...
@@ -155,6 +155,14 @@ class PostgreSqlPlatform extends AbstractPlatform
return
true
;
return
true
;
}
}
/**
* {@inheritDoc}
*/
public
function
hasNativeGuidType
()
{
return
true
;
}
public
function
getListDatabasesSQL
()
public
function
getListDatabasesSQL
()
{
{
return
'SELECT datname FROM pg_database'
;
return
'SELECT datname FROM pg_database'
;
...
...
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
View file @
1f972085
...
@@ -106,6 +106,14 @@ class SQLServerPlatform extends AbstractPlatform
...
@@ -106,6 +106,14 @@ class SQLServerPlatform extends AbstractPlatform
return
false
;
return
false
;
}
}
/**
* {@inheritDoc}
*/
public
function
hasNativeGuidType
()
{
return
true
;
}
/**
/**
* {@inheritDoc}
* {@inheritDoc}
*/
*/
...
...
lib/Doctrine/DBAL/Types/GuidType.php
View file @
1f972085
...
@@ -41,7 +41,7 @@ class GuidType extends StringType
...
@@ -41,7 +41,7 @@ class GuidType extends StringType
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
{
{
return
true
;
return
!
$platform
->
hasNativeGuidType
()
;
}
}
}
}
tests/Doctrine/Tests/DBAL/Types/GuidTypeTest.php
View file @
1f972085
...
@@ -27,5 +27,16 @@ class GuidTest extends \Doctrine\Tests\DbalTestCase
...
@@ -27,5 +27,16 @@ class GuidTest extends \Doctrine\Tests\DbalTestCase
{
{
$this
->
assertNull
(
$this
->
_type
->
convertToPHPValue
(
null
,
$this
->
_platform
));
$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