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
dee01418
Commit
dee01418
authored
Aug 04, 2015
by
Baptiste Clavié
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecate old JsonArrayType
parent
7604e367
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
21 deletions
+6
-21
types.rst
docs/en/reference/types.rst
+4
-0
JsonArrayType.php
lib/Doctrine/DBAL/Types/JsonArrayType.php
+2
-21
No files found.
docs/en/reference/types.rst
View file @
dee01418
...
...
@@ -390,6 +390,10 @@ Values retrieved from the database are always converted to PHP's ``array`` or
json_array
^^^^^^^^^^
.. warning::
This type is deprecated since 2.6, you should use ``json`` instead.
Maps and converts array data based on PHP's JSON encoding functions.
If you know that the data to be stored always is in a valid UTF-8
encoded JSON format string, you should consider using this type.
...
...
lib/Doctrine/DBAL/Types/JsonArrayType.php
View file @
dee01418
...
...
@@ -25,30 +25,11 @@ use Doctrine\DBAL\Platforms\AbstractPlatform;
* Array Type which can be used to generate json arrays.
*
* @since 2.3
* @deprecated Use JsonType instead
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class
JsonArrayType
extends
Type
class
JsonArrayType
extends
Json
Type
{
/**
* {@inheritdoc}
*/
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
{
return
$platform
->
getJsonTypeDeclarationSQL
(
$fieldDeclaration
);
}
/**
* {@inheritdoc}
*/
public
function
convertToDatabaseValue
(
$value
,
AbstractPlatform
$platform
)
{
if
(
null
===
$value
)
{
return
null
;
}
return
json_encode
(
$value
);
}
/**
* {@inheritdoc}
*/
...
...
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