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
360bdf6f
Commit
360bdf6f
authored
Jun 28, 2010
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DBAL-26 - Array and Object data-types also affected by conversion exception error
parent
d0b17ecc
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
0 deletions
+17
-0
ArrayType.php
lib/Doctrine/DBAL/Types/ArrayType.php
+4
-0
ObjectType.php
lib/Doctrine/DBAL/Types/ObjectType.php
+4
-0
ArrayTest.php
tests/Doctrine/Tests/DBAL/Types/ArrayTest.php
+4
-0
ObjectTest.php
tests/Doctrine/Tests/DBAL/Types/ObjectTest.php
+5
-0
No files found.
lib/Doctrine/DBAL/Types/ArrayType.php
View file @
360bdf6f
...
...
@@ -40,6 +40,10 @@ class ArrayType extends Type
public
function
convertToPHPValue
(
$value
,
\Doctrine\DBAL\Platforms\AbstractPlatform
$platform
)
{
if
(
$value
===
null
)
{
return
null
;
}
$value
=
(
is_resource
(
$value
))
?
stream_get_contents
(
$value
)
:
$value
;
$val
=
unserialize
(
$value
);
if
(
$val
===
false
)
{
...
...
lib/Doctrine/DBAL/Types/ObjectType.php
View file @
360bdf6f
...
...
@@ -21,6 +21,10 @@ class ObjectType extends Type
public
function
convertToPHPValue
(
$value
,
\Doctrine\DBAL\Platforms\AbstractPlatform
$platform
)
{
if
(
$value
===
null
)
{
return
null
;
}
$value
=
(
is_resource
(
$value
))
?
stream_get_contents
(
$value
)
:
$value
;
$val
=
unserialize
(
$value
);
if
(
$val
===
false
)
{
...
...
tests/Doctrine/Tests/DBAL/Types/ArrayTest.php
View file @
360bdf6f
...
...
@@ -46,4 +46,8 @@ class ArrayTest extends \Doctrine\Tests\DbalTestCase
$this
->
_type
->
convertToPHPValue
(
'abcdefg'
,
$this
->
_platform
);
}
public
function
testNullConversion
()
{
$this
->
assertNull
(
$this
->
_type
->
convertToPHPValue
(
null
,
$this
->
_platform
));
}
}
\ No newline at end of file
tests/Doctrine/Tests/DBAL/Types/ObjectTest.php
View file @
360bdf6f
...
...
@@ -44,4 +44,9 @@ class ObjectTest extends \Doctrine\Tests\DbalTestCase
$this
->
setExpectedException
(
'Doctrine\DBAL\Types\ConversionException'
);
$this
->
_type
->
convertToPHPValue
(
'abcdefg'
,
$this
->
_platform
);
}
public
function
testNullConversion
()
{
$this
->
assertNull
(
$this
->
_type
->
convertToPHPValue
(
null
,
$this
->
_platform
));
}
}
\ No newline at end of file
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